Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-22126

soap response incorrectly decoded by XMLDecoder

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • Adobe Flex SDK Previous
    • RPC: WebService
    • None
    • Affected OS(s): All OS Platforms
      Affected OS(s): All OS Platforms
      Browser: Internet Explorer 8.x
      Language Found: English

    Description

      I used the FB4 "Connect to web service" option to generate wrappers for a simple web service. The soap response is sent and received and misinterpreted by the XMLDecoder class. I'm not sure if I've got the correct Component (or even Project), but it looks to me like an SDK problem.

      I'm including the wsdl and the soap send and response for a simple webservice that adds two numbers. Hopefully this makes the problem reproducible. The issue appears to be that the mx.rpc.xml.XMLDecoder class unpacks simple types, but at the point where getSimpleValue() is called, 'value' has already been transformed to the raw data (in this case '5'). However, in the getSimpleValue and getValue methods, the 'value' (revealingly passed in with the parameter name 'parent') is expected to be XML or XMLList or a ContentProxy. So the raw data is right there in the input parameter, but the code falls through all of the cases and returns a result of 'undefined'.

      Steps to reproduce:
      1. In FlashBuilder 4, use 'Connect to web service' to generate code from the wsdl
      2. write a simple UI to pass two numbers to the web service
      3. observe that the data in the 'Sum' object is always "NaN" (the marshallBuiltInType() method converts "undefined" double to the 'not a number' value).

      Actual Results:
      NaN

      Expected Results:
      5 (or the correct sum)

      Workaround (if any):
      None that I know of other than getting the XML soap response and interpreting it manually, but that's kind of ridiculous.

      WSDL
      ---------------
      <?xml version="1.0" encoding="UTF-8"?>
      <definitions name="AddFloatsWebSvc"
      xmlns="http://schemas.xmlsoap.org/wsdl/"
      targetNamespace="http://tempuri.org/AddFloatsWebSvc"
      xmlns:tns="http://tempuri.org/AddFloatsWebSvc"
      xmlns:typesns="http://tempuri.org/AddFloatsWebSvc"
      xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
      xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/">
      <types>
      <schema xmlns="http://www.w3.org/2001/XMLSchema"
      targetNamespace="http://tempuri.org/AddFloatsWebSvc"
      xmlns:tns="http://tempuri.org/AddFloatsWebSvc"
      elementFormDefault="qualified">
      <annotation>
      <documentation></documentation>
      </annotation>
      <element name="addfloats">
      <complexType>
      <sequence>
      <element name="parameters"
      type="tns:addfloatsParameters"/>
      </sequence>
      </complexType>
      </element>
      <complexType name="addfloatsParameters">
      <sequence>
      <element name="num1"
      minOccurs="1"
      maxOccurs="1"
      type="double"/>
      <element name="num2"
      minOccurs="1"
      maxOccurs="1"
      type="double"/>
      </sequence>
      </complexType>
      <element name="addfloatsResponse">
      <complexType>
      <sequence>
      <element name="addfloatsResult">
      <complexType>
      <sequence>
      <element name="Parameters">
      <complexType>
      <sequence>
      <element name="Sum"
      minOccurs="0"
      maxOccurs="1">
      <complexType>
      <simpleContent>
      <extension base="double">
      <attribute name="description"
      type="string"/>
      </extension>
      </simpleContent>
      </complexType>
      </element>
      </sequence>
      </complexType>
      </element>
      </sequence>
      </complexType>
      </element>
      </sequence>
      </complexType>
      </element>
      </schema>
      </types>
      <message name="addfloats">
      <part name="parameters"
      element="typesns:addfloats"/>
      </message>
      <message name="addfloatsResponse">
      <part name="parameters"
      element="typesns:addfloatsResponse"/>
      </message>
      <portType name="AddFloatsWebSvcPortType">
      <operation name="addfloats">
      <documentation>
      <description>Adds two "real" (floating point) numbers, returns Sum as output parameter - with no formatting.</description>
      <keywords>
      </keywords>
      </documentation>
      <input message="tns:addfloats"/>
      <output message="tns:addfloatsResponse"/>
      </operation>
      </portType>
      <binding name="AddFloatsWebSvcSoapBinding"
      type="tns:AddFloatsWebSvcPortType">
      <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
      style="document"/>
      <operation name="addfloats">
      <soap:operation soapAction="http://tempuri.org/AddFloatsWebSvc/addfloats"/>
      <input>
      <soap:body use="literal"/>
      </input>
      <output>
      <soap:body use="literal"/>
      </output>
      </operation>
      </binding>
      <service name="AddFloatsWebSvc">
      <port name="AddFloatsWebSvcPort"
      binding="tns:AddFloatsWebSvcSoapBinding">
      <soap:address location="http://computer.com:8080/services/AddFloatsWebSvc"/>
      </port>
      </service>
      </definitions>

      Request
      -------------
      <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:addfloats xmlns:tns="http://tempuri.org/AddFloatsWebSvc"> <tns:parameters> <tns:num1>2</tns:num1> <tns:num2>3</tns:num2> </tns:parameters> </tns:addfloats> </SOAP-ENV:Body></SOAP-ENV:Envelope>

      Response
      -----------------
      <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><m:addfloatsResponse xmlns:m="http://tempuri.org/AddFloatsWebSvc"><m:addfloatsResult><axis2ns1:Parameters xmlns:axis2ns1="http://tempuri.org/AddFloatsWebSvc"><axis2ns2:Sum xmlns:axis2ns2="http://tempuri.org/AddFloatsWebSvc" description="">5</axis2ns2:Sum></axis2ns1:Parameters></m:addfloatsResult></m:addfloatsResponse></soapenv:Body></soapenv:Envelope>

      Attachments

        Activity

          People

            adobejira Adobe JIRA
            adobejira Adobe JIRA
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: