4 Replies Latest reply on Jun 9, 2010 12:48 AM by netweasel

    How to work with SOAP responses?

    netweasel

      Hi everybody!

       

      I'm working with the new "import data" stuff and I'm stuck with the responses. It doesn't matter whether I try to get to the results over CallResponder.token.result oder CallResponder.lastResult, I simply get "undefined" values for both properties. But the ResultEvent.message property shows just the right response  SOAP message. How can I get a proper response out of this message?

       

      Regards and thanks

      Lukas

        • 1. Re: How to work with SOAP responses?
          Flex harUI Adobe Employee

          I am using lastResult when the result event is dispatched.

          • 2. Re: How to work with SOAP responses?
            netweasel Level 1

            Hi!

             

            Thanks for replying. This is what one is supposed to do. But in my case, lastResult is not defined. When introspecting a wsdl, fb4 creates all the value objects for the datatypes related to the given service. As I have understood, the lastResult should even be of type MyMethodResonse extending _Super_MyMethodResponse.

            • 3. Re: How to work with SOAP responses?
              Flex harUI Adobe Employee

              Post your code.  Maybe you're not waiting for the result event?

              • 4. Re: How to work with SOAP responses?
                netweasel Level 1

                Ok, there you go.

                 

                Script:

                 

                protected function button_clickHandler(event:MouseEvent):void

                {

                     loginRequest.Email = emailTextInput.text;

                     loginRequest.Password = passwordTextInput.text;

                 

                     LoginResult2.token = profileServices.Login(loginRequest);

                }


                protected function LoginResult2_resultHandler(event:ResultEvent):void

                {

                     trace (event.message.body); //Returns the XML Message

                     trace (loginResponse);     //Returns null

                }

                 

                Markup Declarations:

                 

                <profile:ProfileServices id="profileServices" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor="true"/>

                 

                 

                <profile2:LoginRequest id="loginRequest"/>

                 

                <s:CallResponder id="LoginResult2" result="loginResponse = LoginResult2.lastResult as LoginResponse; LoginResult2_resultHandler(event); "/>

                 

                 

                 

                <profile2:LoginResponse id="loginResponse">

                     <profile2:Result>

                          <profile2:ResultStatus/>

                     </profile2:Result>

                </profile2:LoginResponse>

                 

                 

                Markup Form:

                 

                <mx:Form defaultButton="{button}">

                     <mx:FormItem label="Email">

                          <s:TextInput id="emailTextInput" text="{loginRequest.Email}"/>

                     </mx:FormItem>

                     <mx:FormItem label="Password">

                          <s:TextInput id="passwordTextInput" text="{loginRequest.Password}"/>

                     </mx:FormItem>

                     <s:Button label="Login" id="button" click="button_clickHandler(event)"/>

                </mx:Form>

                 

                 

                Thanks for having a look.