3 Replies Latest reply on Dec 23, 2009 3:22 AM by Marc de kwant

    Webservice client generated from WSDL null entity problem

    Marc de kwant

      hi,

       

      I'am having a serious problem using the generation (data centric development) capability of Flash builder.

      I have a simple XSD and generated WSLD (from Spring Framework using JAXB). In this I have defined an UpdateRelatie function.

      It looks something like this:

       

          <xsd:element name="UpdateRelatieRequest">

              <xsd:complexType>

                   <xsd:sequence>

                      <xsd:element name="relatie" type="relatie" minOccurs="1" maxOccurs="1"/>

                  </xsd:sequence>

              </xsd:complexType>

          </xsd:element>

       

          <xsd:element name="UpdateRelatieResponse">

              <xsd:complexType>

                  <xsd:sequence>

                      <xsd:element name="relatie" type="relatie" minOccurs="1" maxOccurs="1"/>

                  </xsd:sequence>

              </xsd:complexType>

          </xsd:element>

          <xsd:complexType name="relatie">

              <xsd:sequence>

                  <xsd:element name="id" type="xsd:int" />

                  <xsd:element name="naam" type="xsd:string" />

                  <xsd:element name="telefoonNummer" type="xsd:string" />

                  <xsd:element name="mobielNummer" type="xsd:string" />

                  <xsd:element name="email" type="xsd:string" />

                  <xsd:element name="rekeningNummer" type="xsd:string" />

                  <xsd:element name="btwNummer" type="xsd:string" />

                  <xsd:element name="kvkNummer" type="xsd:string" />

                  <xsd:element name="actief" type="xsd:boolean" />

              </xsd:sequence>

          </xsd:complexType>

       

      My generated WSDL looks something like this (for the update part as show above).

       

      <?xml version="1.0" encoding="UTF-8" standalone="no"?><wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:schema="http://www.mydomain.nl/gbs/service/ws" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace="http://www.mydomain.nl/gbs/service/ws">

        <wsdl:types>

          <xsd:schema xmlns="http://www.mydomain.nl/gbs/service/ws" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.mydomain.nl/gbs/service/ws">

       

        [excluded xsd.. see above]

       

      </xsd:schema>

        </wsdl:types>

        <wsdl:message name="UpdateRelatieRequest">

          <wsdl:part element="schema:UpdateRelatieRequest" name="UpdateRelatieRequest">

          </wsdl:part>

        </wsdl:message>

        <wsdl:message name="UpdateRelatieResponse">

          <wsdl:part element="schema:UpdateRelatieResponse" name="UpdateRelatieResponse">

          </wsdl:part>

        </wsdl:message>

         <wsdl:portType name="Relatie">

          <wsdl:operation name="UpdateRelatie">

            <wsdl:input message="schema:UpdateRelatieRequest" name="UpdateRelatieRequest">

          </wsdl:input>

            <wsdl:output message="schema:UpdateRelatieResponse" name="UpdateRelatieResponse">

          </wsdl:output>

          </wsdl:operation>

        </wsdl:portType>

        <wsdl:binding name="RelatieBinding" type="schema:Relatie">

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

          <wsdl:operation name="UpdateRelatie">

            <soap:operation soapAction=""/>

            <wsdl:input name="UpdateRelatieRequest">

              <soap:body use="literal"/>

            </wsdl:input>

            <wsdl:output name="UpdateRelatieResponse">

              <soap:body use="literal"/>

            </wsdl:output>

          </wsdl:operation>

        </wsdl:binding>

        <wsdl:service name="RelatieService">

          <wsdl:port binding="schema:RelatieBinding" name="RelatiePort">

            <soap:address location="http://localhost:8080/GBS/relatieService"/>

          </wsdl:port>

        </wsdl:service>

      </wsdl:definitions>

       

      When I run my test client written in Java, I can update any given relatie-object in my database.

       

      BUT when I, based upon this, generate a webservice stub using the "data -> connect to webservice" option. I get nicely generated code and the ability to to bind this to an form with which I can edit the data.

       

      Now for my PROBLEM:

       

      When I enter data in the form, during the process of transforming my Relatie object to XML, my entire object disappears. i.e. my object does NOT get transformed to XML for soap transport. Somewhere deep in the webservice code, it just gets ignored and I do NOT know why.

       

      What does work is retrieving data through a webservice. I can display a nice grid full of data from my database. What does not work is trying to send a domain object (Relatie) from Flex through a webservice and process it in java. The object is null on the java side. I can even see in the resulting soap envelope that nothing gets transformed to XML. See output below:

       

      <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>   

          <schema:UpdateRelatieRequest xmlns:schema="http://www.mydomain.nl/gbs/service/ws"/>  <!-- NO OBJECT -->

        </SOAP-ENV:Body>

      </SOAP-ENV:Envelope>

       

      Which should have been based upon the given WSDL (as the java client does send over the wire)

       

      <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">

      <SOAP-ENV:Body>

        <ns3:InsertRelatieRequest xmlns:ns3="http://www.mydomain.nl/gbs/service/ws">

          <relatie>

            <btwNummer>BTW</btwNummer>                                                                                            <!-- OBJECT PRESENT -->

            <actief>false</actief>

         </relatie>

        </ns3:InsertRelatieRequest>

      </SOAP-ENV:Body>

      </SOAP-ENV:Envelope>

       

      Can anyone help me please. I'am stuck now.

       

       

      Kind regards,

       

      Marc