Found instance data for Header in the soap:body instead of the soap:header for
valid looking XML
------------------------------------------------------------------------------------------------
Key: AXIS-2149
URL: http://issues.apache.org/jira/browse/AXIS-2149
Project: Apache Axis
Type: Bug
Components: Serialization/Deserialization
Versions: 1.2.1
Environment: Windows XP
Sun JDK 1.4.2
JBoss 3.2.x
Reporter: Kristian Andersen
In a soc/literal webservice I receive a org.xml.sax.SAXException: Found
instance data for {http://my.namespace.com}Header in the soap:body instead of
the soap:header when calling an operation that has a soap:header message
defined, but no soap:body messages.
I have written the WSDL as it is described below, unfortunateley I am unable to
attach the actual WSDL. I am using WSDL2java to
genereate both client and serverside code. When running, the client generates
XML as described below and the server responds with a org.xml.sax.SAXException:
Found instance data for {http://my.namespace.com}Header in the soap:body
instead of the soap:header
Description of WSDL:
------8<----------
<wsdl:message name="MethodRequest">
<wsdl:part name="Header" element="namespace:Header"/>
</wsdl:message>
<wsdl:message name="MethodResponse">
<wsdl:part name="MethodResponse" element="namespace:MethodResponse"/>
</wsdl:message>
<wsdl:message name="MethodFault">
<wsdl:part name="MethodFault" element="namespace:MethodFault""/>
</wsdl:message>
------8<----------
<wsdl:operation name="Method">
<wsdl:input name="MethodRequest" message="tns:MethodRequest"/>
<wsdl:output name="MethodResponse" message="tns:MethodResponse"/>
<wsdl:fault name="MethodFault" message="tns:MethodFault"/>
</wsdl:operation>
------8<----------
<wsdl:operation name="Method">
<wsdlsoap:operation style="document" soapAction="Method"/>
<wsdl:input>
<wsdlsoap:header part="Header" use="literal"/>
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<wsdlsoap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="MethodFault">
<wsdlsoap:fault name="MethodFault" use="literal"/>
</wsdl:fault>
</wsdl:operation>
------8<----------
Resulting XML 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:Header>
<namespace:Header xmlns:namespace="http://my.namespace.com">
<!--Header data goes her, it is looking OK-->
</namespace:Header>
</soapenv:Header>
<soapenv:Body>
<Method xmlns=""/>
</soapenv:Body>
</soapenv:Envelope>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira