Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.4
-
None
-
None
-
Windows XP, java 6 running in Eclipse 3.3
Description
Used axis wsdl2java to generate client code. Am attempting to send a simple message but it is being rejected as invalid for the xsd. Looked at the log and it seems there is a duplicate wrapper around the payload.
Log message:
=======================================================
= Elapsed: 62 milliseconds
= In message: <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><getAvailability xmlns="http://www.mycompany.com.au/schema/2005/01/basic.xsd"><getAvailability><passengerCount xmlns="">1</passengerCount><flights xmlns=""><query><departureAirport>SYD</departureAirport><arrivalAirport>MEL</arrivalAirport><departsAfterTime>2007-01-28T14:00:00.316Z</departsAfterTime></query></flights></getAvailability></getAvailability></soapenv:Body></soapenv:Envelope>
= Out message: <?xml version="1.0" encoding="utf-8"?><soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"><soap-env:Body><soap-env:Fault>
<faultcode>soap-env:Client.doesNotValidate</faultcode>
<faultstring>Attempt to access element '
getAvailability' failed: No such element. Child content is [passengerCount, flights] for getAvailability at Envelope.Body.getAvailability</faultstring>
<faultactor>http://wwwmgmt:8080/api/service</faultactor>
</soap-env:Fault></soap-env:Body></soap-env:Envelope>
=======================================================
Clean this up to see the actual xml being sent is:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<getAvailability xmlns="http://www.mycompany.com.au/schema/2005/01/basic.xsd">
<getAvailability>
<passengerCount xmlns="">1</passengerCount>
<flights xmlns="">
<query>
<departureAirport>SYD</departureAirport>
<arrivalAirport>MEL</arrivalAirport>
<departsAfterTime>2007-01-28T14:00:00.316Z</departsAfterTime>
</query>
</flights>
</getAvailability>
</getAvailability>
</soapenv:Body>
</soapenv:Envelope>
This shows that getAvailability is being included twice, without a namespace. However comparing this against what our old manual code would send:
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<my:getAvailability xmlns:my="http://www.mycompany.com.au/schema/2005/01/basic.xsd">
<passengerCount>1</passengerCount>
<flights>
<query>
<departureAirport>SYD</departureAirport>
<arrivalAirport>MEL</arrivalAirport>
<departsAfterTime>2007-01-28T14:00:00.316Z</departsAfterTime>
</query>
</flights>
</my:getAvailability>
</soapenv:Body>
</soapenv:Envelope>
The xsd reguarding this element (from basic.xsd) is:
<xsd:element name="getAvailability">
<xsd:complexType>
<xsd:all>
<xsd:element name="passengerCount" type="xsd:positiveInteger" minOccurs="0"/>
<xsd:element name="flights">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="query" type="com:AvailabilityQuery" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:all>
</xsd:complexType>
</xsd:element>