1 Reply Latest reply on Oct 5, 2007 12:36 PM by gtcroz

    Flex 3 Web Services not parsing response properly

    gtcroz
      I'm using the Flex 3 WSDL Introspection and the generated code. For most of my simple use cases this has worked perfectly. However I have a complex response type that I'm trying to use and it's not working. Any help would be much appreciated.

      There are 3 fields in the expected response:

      <xsd:element minOccurs="0" name="callFowardingEntries" nillable="true" type="ns1:ArrayOfCallForwardingSelectiveEntry"/>
      <xsd:element minOccurs="0" name="forwardToPhoneNumber" nillable="true" type="xsd:string"/>
      <xsd:element minOccurs="0" name="playRingReminder" type="xsd:boolean"/>

      The String and the Boolean are coming back successfully but the ArrayOfCallForwardingSelectiveEntry is coming back as null even though valid data was returned. I don't think it is getting parsed correctly.

      Here's the request that was created using the generated actionscript:

      <SOAP-ENV:Envelope xmlns:SOAP-ENV=" http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd=" http://www.w3.org/2001/XMLSchema" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance">
      <SOAP-ENV:Body>
      <tns:getCallForwardingSelectiveForUser xmlns:tns=" http://webservice.pca.company.net">
      <tns:userId>1234567@gofca.company.net</tns:userId>
      </tns:getCallForwardingSelectiveForUser>
      </SOAP-ENV:Body>
      </SOAP-ENV:Envelope>

      Here is the response that I got back:

      <soap:Envelope xmlns:soap=" http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd=" http://www.w3.org/2001/XMLSchema" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance">
      <soap:Body>
      <getCallForwardingSelectiveForUserResponse xmlns=" http://webservice.pca.company.net">
      <out xmlns=" http://webservice.pca.company.net">
      <callFowardingEntries xmlns=" http://dto.pca.company.net">
      <CallForwardingSelectiveEntry>
      <active>false</active>
      <anyPrivateNumber>false</anyPrivateNumber>
      <anyUnavailableNumber>false</anyUnavailableNumber>
      <description>Rock ON</description>
      <displayableFromNumber>All calls</displayableFromNumber>
      <forwardFromAnyNumber>true</forwardFromAnyNumber>
      <forwardToAnotherNumber>false</forwardToAnotherNumber>
      <forwardToDefaultNumber>true</forwardToDefaultNumber>
      <forwardToNumber>Default</forwardToNumber>
      <telephoneNumbers/>
      <timeSchedule xsi:nil="true"/>
      <timeScheduleName/>
      </CallForwardingSelectiveEntry>
      <CallForwardingSelectiveEntry>
      <active>true</active>
      <anyPrivateNumber>false</anyPrivateNumber>
      <anyUnavailableNumber>false</anyUnavailableNumber>
      <description>Rule Numero Dos</description>
      <displayableFromNumber>All calls</displayableFromNumber>
      <forwardFromAnyNumber>true</forwardFromAnyNumber>
      <forwardToAnotherNumber>false</forwardToAnotherNumber>
      <forwardToDefaultNumber>true</forwardToDefaultNumber>
      <forwardToNumber>Default</forwardToNumber>
      <telephoneNumbers/>
      <timeSchedule xsi:nil="true"/>
      <timeScheduleName/>
      </CallForwardingSelectiveEntry>
      <CallForwardingSelectiveEntry>
      <active>true</active>
      <anyPrivateNumber>false</anyPrivateNumber>
      <anyUnavailableNumber>false</anyUnavailableNumber>
      <description>asdfasdf</description>
      <displayableFromNumber>All calls</displayableFromNumber>
      <forwardFromAnyNumber>true</forwardFromAnyNumber>
      <forwardToAnotherNumber>false</forwardToAnotherNumber>
      <forwardToDefaultNumber>true</forwardToDefaultNumber>
      <forwardToNumber>Default</forwardToNumber>
      <telephoneNumbers/>
      <timeSchedule xsi:nil="true"/>
      <timeScheduleName/>
      </CallForwardingSelectiveEntry>
      </callFowardingEntries>
      <forwardToPhoneNumber xmlns=" http://dto.pca.company.net">123456789</forwardToPhoneNumber>
      <playRingReminder xmlns=" http://dto.pca.company.net">true</playRingReminder>
      </out>
      </getCallForwardingSelectiveForUserResponse>
      </soap:Body>
      </soap:Envelope>


      Here's the WSDL:


        • 1. Flex 3 Web Services not parsing response properly
          gtcroz Level 1
          Similarly, it also has a problem encoding my request when I call the setter. I get this error:

          Error: String '[object CallForwardingSelectiveEntry],[object CallForwardingSelectiveEntry],[object CallForwardingSelectiveEntry]' is not a Boolean.

          Could it be that it thinks the ArrayOfCallForwardingSelectiveEntry is really a Boolean for some reason?

          This is the line in my generated code that caused the problem:

          soap = enc.encodeRequest(args,headers);

          I can't drill down any deeper because I don't have the source code. The SOAPEncoder also doesn't show up on the Flex 3 API Reference online.