Skip navigation
Currently Being Moderated

SOAP decoding collections

Aug 30, 2013 9:00 AM

Hi all,

 

So I have a soap response whose soap body looks something like this:

 

<response>
     <models>
          <model>...</model>
          <model>...</model>
          <model>...</model>
     </models>
</response>

 

I have AS classes to represent the response like this:

 

class Model {
     ...
}

 

class ModelsResponse {
     public var models:ArrayCollection;
}

 

And I register both the Model and ModelsResponse type.

 

However, the result after decoding is just an ArrayCollection of Model objects, not a decoded ModelResponse object. What might be going wrong?

 

-Aaron

 
Replies
  • Currently Being Moderated
    Aug 30, 2013 12:13 PM   in reply to Aaron Beall

    What do you mean when you say you registered those types?

     

    It's been a little while since I've worked with SOAP services (switched to JSON everywhere I could), but I believe this is done from the Data/Services tab in Flash Builder.  You've defined your service, right click on the service method, and choose "Configure Return Type".  You should be able to map your SOAP response to the appropriate types.

     

    Here's the Adobe product support page about configuring data types for data service operations.

     

    Hope that helps,

      -Josh

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 30, 2013 1:01 PM   in reply to Aaron Beall

    Interesting, I wasn't aware of this method of interacting with SOAP services.  I'm guessing it's how the Flash Builder's UI is working under the covers, but I've never messed with it.

     

    How do you define your mapping between the types you've defined and the XML?  Does Flex just try to automagically figure out what XML looks like it's the same "shape" as one of your registered types?

     

    I'm thinking there may be a way to explicitly map your types to different parts of your XML response.  That's what you would do in the "Configure return types" screen.

     

    The other thing you could do is try stepping through the deserialization code to try and understand what it's doing.

     

      -Josh

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 30, 2013 1:04 PM   in reply to JoshBeall

    What's the exact error you get trying to import the WSDL?  If you post it here, maybe somebody could help get it figured out.  If you can get the data services UI in Flash Builder working, I bet it will make this problem more manageable.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 30, 2013 2:14 PM   in reply to Aaron Beall

    Definitely sounds like some Flex automagical stuff is happening... does the WSDL validate?  A quick Google search reveals some WSDL validators... I would have thought that Flash Builder would be able to pull in properly referenced XSD files, so I'm wondering if there's something wrong with the WSDL.  Possible?

     

    http://wsdl-analyzer.com/

    http://www.validwsdl.com/

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points