2 Replies Latest reply on Apr 29, 2010 5:52 AM by MrRikard

    Generated webservice code doesnt support aggregation ?

    MrRikard

      Im trying to run generated code from a wsdl describing my webservices. The wsdl is created on the following xsd-example:

       

      <xsd:element name="XRequest">
          <xsd:complexType>
              <xsd:sequence>
                  <xsd:element name="Body" type="tslc:XBody" minOccurs="0" maxOccurs="unbounded" />
              </xsd:sequence>
          </xsd:complexType>
      </xsd:element>
      <xsd:complexType name="XBody">
          <xsd:sequence>
              <xsd:element name="ReqId" type="xsd:string" />
          </xsd:sequence>
      </xsd:complexType>
      When flex generates the code based on wsdl from this xsd it looks ok. (from menu Data - Import WebServices). When i try to send a request and trace the request from the generated code it looks like this:
      <tslc:XRequest xmlns:tslc="http://www.xxx.com/x/tslc">
        <tslc:Body>
          <tslc:ReqId>[object XBody]</tslc:ReqId>
          <tslc:ReqId2>[object XBody]</tslc:ReqId2>
        </tslc:Body>
      </tslc:XRequest>
      If I debug the flex classes (not the generated) I can see that its looking in the wrong place therefor "toString" on XBody instead of XBody.ReqId.
      As soon as Im using aggregation in the xsd and include an "object" into another and dont use a "flat" xsd-structure I get this behavoir.
      Any ideas why the generated code does this ?
      /Rikard
        • 1. Re: Generated webservice code doesnt support aggregation ?
          Radhakrishna Bhat Level 3

          Can you please share the WSDL? or email me at "rbhat AT adobe.com"

           

          -Radhakrishna

          • 2. Re: Generated webservice code doesnt support aggregation ?
            MrRikard Level 1

            This is of course a stripped down problem of our real case, but it illustrates the point. We have used SoapUI to also generate sample requests, and they look correct when SoapUI generates them.

             

            The request generated by SoapUI:

             

            <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tslc="http://www.seb.se/mb/tslc">

            <soapenv:Header/>

                 <soapenv:Body>

                      <tslc:XRequest>

                           <tslc:Body>

                                <tslc:ReqId>?</tslc:ReqId>

                           </tslc:Body>

                      </tslc:XRequest>

                 </soapenv:Body>

             

            This is how we create the request from our Flex code (I hope it is correct):

             

             

            var request : X_request = new X_request();
            var bodies : Array = new Array();
            var body : XBody = new XBody();
            body.ReqId = "4711";
            bodies.push(body);
            request.Body = bodies;

            service.x_request_var = request;
            service.x_send();

             

             

             

             

             

             

             

            The wsdl:

             

            <?xml version="1.0" encoding="UTF-8" standalone="no"?><wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:sch="http://www.xxx.com/xx/tslc" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.xxx.com/xx/t2/definitions" targetNamespace="http://www.xxx.com/mb/t2/definitions">

            <wsdl:types>

            <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tslc="http://www.xxx.com/mb/tslc" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://www.xxx.com/mb/tslc">

             

            <element name="XRequest">

                 <complexType>

                      <sequence>

                           <element maxOccurs="unbounded" minOccurs="0" name="Body"type="tslc:XBody"/>

                      </sequence>

                 </complexType>

            </element>

             

            <complexType name="XBody">

                 <sequence>

                      <element name="ReqId" type="string"/>

                 </sequence>

            </complexType>

             

            <element name="XResponse">

                 <complexType>

                      <sequence>

                           <element name="ReqId" type="string"/>

                      </sequence>

                 </complexType>

            </element>

            </schema>

            </wsdl:types>

             

            <wsdl:message name="XRequest">

            <wsdl:part element="sch:XRequest" name="XRequest">

            </wsdl:part>

            </wsdl:message>

             

            <wsdl:message name="XResponse">

            <wsdl:part element="sch:XResponse" name="XResponse">

            </wsdl:part>

            </wsdl:message>

             

            <wsdl:portType name="tslcPort">

            <wsdl:operation name="X">

            <wsdl:input message="tns:XRequest" name="XRequest">

            </wsdl:input>

            <wsdl:output message="tns:XResponse" name="XResponse">

            </wsdl:output>

            </wsdl:operation>

            </wsdl:portType>

             

            <wsdl:binding name="tslcPortSoap11" type="tns:tslcPort">

            <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>

            <wsdl:operation name="X">

            <soap:operation soapAction=""/>

            <wsdl:input name="XRequest">

            <soap:body use="literal"/>

            </wsdl:input>

            <wsdl:output name="XResponse">

            <soap:body use="literal"/>

            </wsdl:output>

            </wsdl:operation>

            </wsdl:binding>

             

            <wsdl:service name="tslcPortService">

            <wsdl:port binding="tns:tslcPortSoap11" name="tslcPortSoap11">

            <soap:address location="http://localhost:8080/tslc/service/"/>

            </wsdl:port>

            </wsdl:service>

             

            </wsdl:definitions>

             

             

            Any help would be much appreciated