Details
Description
In my wsdl I've the following message:
<wsdl:operation name="Security_Authenticate">
<soap:operation soapAction="http://xxxxxxxxxxxxxxxxxxx"/>
<wsdl:input>
<soap:header message="aws:Session" part="Session" use="literal"/>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:header message="aws:Session" part="Session" use="literal"/>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
The Session type used in the header is defined as follow:
<xs:element name="Session">
<xs:complexType>
<xs:sequence>
<xs:element name="SessionId" type="xs:string">
<xs:annotation>
<xs:documentation>This element defines the identifier part of the SessionId.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="SequenceNumber" type="xs:string">
<xs:annotation>
<xs:documentation>This element defines the sequence number of the SessionId.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="SecurityToken" type="xs:string">
<xs:annotation>
<xs:documentation>This element defines the SecurityToken of the SessionId.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
I'm using adb binding.
The actual soap message generated is
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<ns1:Session xmlns:ns1="http://xxxxxxxxxxxxx.xsd" soapenv:mustUnderstand="0">
<ns1:SessionId>xxxxx</ns1:SessionId>
</ns1:Session>
</soapenv:Header>
<soapenv:Body>
<ns38:Security_Authenticate xmlns:ns38="........
The Session element in the header is wrong because are missing two childs SequenceNumber and SecurityToken
I had a look on the sources for axis2 and axiom and, in my opinion, the problem is in the method org.apache.axis2.client.Stub.addHeader()
protected void addHeader(OMElement omElementToadd,
SOAPEnvelope envelop,
boolean mustUnderstand){
SOAPHeaderBlock soapHeaderBlock =
envelop.getHeader().addHeaderBlock(omElementToadd.getLocalName(),omElementToadd.getNamespace());
soapHeaderBlock.setMustUnderstand(mustUnderstand);
OMNode omNode = null;
// add child elements
for (Iterator iter = omElementToadd.getChildren(); iter.hasNext()
OMAttribute omatribute = null;
// add attributes
for (Iterator iter = omElementToadd.getAllAttributes(); iter.hasNext()
}
Attachments
Issue Links
- duplicates
-
AXIS2-5071 Failure to populate all members of an xs:sequence in a SOAP header
- Resolved