users@jax-ws.java.net

Problem mapping soap response to java objects

From: <breadfan_at_gmx.de>
Date: Thu, 27 Apr 2006 17:59:01 +0200 (MEST)

Hi,

I have a problem with jaxws 2.0ea3 (and also nightly 20060426) when it comes
to map the soap response of an external system (Tibco) back to tha jax-ws
generated java classes.
Request is correctly 'mapped' to soap, well-interpreted by the external
system, which produces a correct response, but jax-ws cannot map the soap
response to java:

I get an: javax.xml.ws.WebServiceException: unexpected XML reader state.
expected: END_ELEMENT but found: START_ELEMENT

The response from the tibco server seems to be ok:

------------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">

  <SOAP-ENV:Header />
  <SOAP-ENV:Body>
    <ns0:checkAddressResponse xmlns:xs="http://www.w3.org/2001/XMLSchema"
                             
xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/"
                             
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                              xmlns:ns0="http://OutputMessageNamespace">
      <checkAddressResult
xmlns:ns="http://someCompany.com/fss/services/Portal_checkAddress_result"
                          xsi:type="ns:Portal_checkAddress_result">
        <ns:commonMessageHeaderResult>
          <ns:sourceSystem>Portal</ns:sourceSystem>
          <ns:eventID>0.2.1146071898457.0</ns:eventID>
          <ns:timeStamp>2006-04-26T19:38:21</ns:timeStamp>
          <ns:serviceName>checkAddress</ns:serviceName>
        </ns:commonMessageHeaderResult>
        <ns:Portal_message_checkAddress_result>
          <ns:Address_Check_Response>
            <ns:overallResult>0</ns:overallResult>
            <ns:overallRemark>String</ns:overallRemark>
            <ns:Single_Checked_Address>
              <ns:result>0</ns:result>
              <ns:remark>String</ns:remark>
              <ns:Location_Address>
                <ns:zipCode>10007</ns:zipCode>
                <ns:city>K&#195;&#182;ln</ns:city>
                <ns:street>Venloer Str.</ns:street>
                <ns:houseNumber>330</ns:houseNumber>
                <ns:checked>true</ns:checked>
                <ns:active>true</ns:active>
                <ns:Country_Code>DEU</ns:Country_Code>
                <ns:Address_Type>main_address</ns:Address_Type>
                <ns:zoneInformation>
                  <ns:Zone_Type>PWI</ns:Zone_Type>
                  <ns:referredLocation_ref>
                  _</ns:referredLocation_ref>
                </ns:zoneInformation>
                <ns:addressee_ref>_</ns:addressee_ref>
                <ns:contactAddressee_ref>
                _</ns:contactAddressee_ref>
              </ns:Location_Address>
            </ns:Single_Checked_Address>
          </ns:Address_Check_Response>
        </ns:Portal_message_checkAddress_result>
      </checkAddressResult>
    </ns0:checkAddressResponse>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
--------------------------------------------------------------------------

I have implemented a test service implementation with jax-ws and (sure) it
works and returns a response which looks quite well, also:

--------------------------------------------------------------------------
<?xml version="1.0"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                 
xmlns:ns1="http://someCompany.com/fss/services/Portal_checkAddress_request"
                 
xmlns:ns2="http://someCompany.com/fss/services/Portal_checkAddress_result"
               


xmlns:ns3="http://web.services.galileo.someCompany.com/internal/checkAddress">
  <soapenv:Body>
    <ans:checkAddressResponse
xmlns:ans="http://web.services.galileo.someCompany.com/checkAddressImpl">
      <checkAddressResult>
        <ns2:commonMessageHeaderResult>
          <ns2:sourceSystem>Portal</ns2:sourceSystem>
          <ns2:eventID>0.2.1146071898457.0</ns2:eventID>
          <ns2:timeStamp>2006-04-26T19:38:21</ns2:timeStamp>
          <ns2:serviceName>checkAddress</ns2:serviceName>
        </ns2:commonMessageHeaderResult>
        <ns2:Portal_message_checkAddress_result>
          <ns2:Address_Check_Response>
            <ns2:overallResult>0</ns2:overallResult>
            <ns2:overallRemark>String</ns2:overallRemark>
            <ns2:Single_Checked_Address>
              <ns2:result>0</ns2:result>
              <ns2:remark>String</ns2:remark>
              <ns2:Location_Address>
                <ns2:zipCode>10007</ns2:zipCode>
                <ns2:city>K&#195;&#182;ln</ns2:city>
                <ns2:street>Venloer Str.</ns2:street>
                <ns2:houseNumber>330</ns2:houseNumber>
                <ns2:checked>true</ns2:checked>
                <ns2:active>true</ns2:active>
                <ns2:Country_Code>DEU</ns2:Country_Code>
                <ns2:Address_Type>main_address</ns2:Address_Type>
                <ns2:zoneInformation>
                  <ns2:Zone_Type>PWI</ns2:Zone_Type>
                  <ns2:referredLocation_ref>
                  _</ns2:referredLocation_ref>
                </ns2:zoneInformation>
                <ns2:addressee_ref>_</ns2:addressee_ref>
                <ns2:contactAddressee_ref>
                _</ns2:contactAddressee_ref>
              </ns2:Location_Address>
            </ns2:Single_Checked_Address>
          </ns2:Address_Check_Response>
        </ns2:Portal_message_checkAddress_result>
      </checkAddressResult>
    </ans:checkAddressResponse>
  </soapenv:Body>
</soapenv:Envelope>

I attached the wsdl-file which I used to generate the java classes.

The differences I see are:

1. Empty soap header element in tibco response.
2. Different namespace definition of the checkAddressResponse-type.

Could these differences result in a problem? I have no clue.
Do you have any ideas, where the problem is coming from?

Thanks in advance,

Chris Wewerka

-- 
Echte DSL-Flatrate dauerhaft für 0,- Euro*!
"Feel free" mit GMX DSL! http://www.gmx.net/de/go/dsl