You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Steven E. Harris" <se...@panix.com> on 2007/04/03 04:14:19 UTC
Addressing module puts WS-Addressing elements after SOAP body
I'm using AXIS2 to write a client, and I figured out how to engage the
addressing module. Testing reveals some odd behavior.
With addressing engaged, AXIS2 emits a SOAP request with this
structure:
<soapenv:Envelope
xmlns:wsa="http://www.w3.org/2005/08/addressing"
xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Header />
<soapenv:Body>
...
</soapenv:Body>
<soapenv:Header>
<wsa:To>...</wsa:To>
<wsa:MessageID>...</wsa:MessageID>
<wsa:Action>...</wsa:Action>
</soapenv:Header>
</soapenv:Envelope>
Notice the extra Header /after/ the Body? Surely that can't be
right. Has anyone else noticed this behavior?
--
Steven E. Harris
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
Re: Addressing module puts WS-Addressing elements after SOAP body
Posted by "Steven E. Harris" <se...@panix.com>.
"Steven E. Harris" <se...@panix.com> writes:
> That's good news: this did work at some point.
And apparently it still does, if one uses the SNAPSHOT version of
axiom-impl, as opposed to the most recently released version
1.2.2.
Once I forced the SNAPSHOT version into use, the addressing module
adds the proper headers to the SOAP message, and the weird extra
header element no longer appears after the body.
--
Steven E. Harris
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
Re: Addressing module puts WS-Addressing elements after SOAP body
Posted by "Steven E. Harris" <se...@panix.com>.
aaron aston <as...@gotwisted.com> writes:
> I'm also using Axis2 on the client, with WS-Addressing. My requests
> have the header first, and no empty header like you're seeing. I'm
> using v1.1.1.
That's good news: this did work at some point.
> I'm new to Axis2, so I don't really know what to suggest to help you;
> I just wanted you to know that it works for me ...
>
> How did you 'engage' addressing?
In my code, as follows:
stub._getServiceClient().engageModule(
new javax.xml.namespace.QName( org.apache.axis2.Constants.MODULE_ADDRESSING ) );
> I'm using an axis2.xml config file (ie: I don't do configuration 'in
> code'), and I have a
>
> <module ref="addressing"/>
>
> therein.
I had commented that line out, as I wasn't sure I wanted to enable
addressing for every operation. Still, I tried to remove the call
above from my code and enable addressing in the axis2.xml file as you
suggest, but I get the same output.
Interesting discovery: the output I reported yesterday came with an
XMLBeans binding. Today I've been experimenting with JiBX
again. Without the addressing module engaged, the serialized SOAP
message looks fine. With addressing engaged, I see the following
error:
Exception in thread "main" org.apache.axiom.om.OMException: SOAPEnvelope must contain a body element which is either first or second child element of the SOAPEnvelope.
at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.getBody(SOAPEnvelopeImpl.java:145)
at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.addChild(SOAPEnvelopeImpl.java:106)
at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.getHeader(SOAPEnvelopeImpl.java:84)
at org.apache.axis2.handlers.addressing.AddressingOutHandler$WSAHeaderWriter.<init>(AddressingOutHandler.java:140)
at org.apache.axis2.handlers.addressing.AddressingOutHandler.invoke(AddressingOutHandler.java:106)
at org.apache.axis2.engine.Phase.invoke(Phase.java:383)
at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:203)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:433)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:330)
at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294)
That adds some evidence to the out-of-order problem witnessed with the
XMLBeans output.
--
Steven E. Harris
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
Re: Addressing module puts WS-Addressing elements after SOAP body
Posted by aaron aston <as...@gotwisted.com>.
I'm also using Axis2 on the client, with WS-Addressing. My requests
have the header first, and no empty header like you're seeing. I'm
using v1.1.1.
I'm new to Axis2, so I don't really know what to suggest to help
you; I just wanted you to know that it works for me ...
How did you 'engage' addressing? I'm using an axis2.xml config file
(ie: I don't do configuration 'in code'), and I have a
<module ref="addressing"/>
therein.
Aaron.
On 2-Apr-07, at 10:14 PM, Steven E. Harris wrote:
> I'm using AXIS2 to write a client, and I figured out how to engage the
> addressing module. Testing reveals some odd behavior.
>
> With addressing engaged, AXIS2 emits a SOAP request with this
> structure:
>
> <soapenv:Envelope
> xmlns:wsa="http://www.w3.org/2005/08/addressing"
> xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
> <soapenv:Header />
> <soapenv:Body>
> ...
> </soapenv:Body>
> <soapenv:Header>
> <wsa:To>...</wsa:To>
> <wsa:MessageID>...</wsa:MessageID>
> <wsa:Action>...</wsa:Action>
> </soapenv:Header>
> </soapenv:Envelope>
>
>
> Notice the extra Header /after/ the Body? Surely that can't be
> right. Has anyone else noticed this behavior?
>
> --
> Steven E. Harris
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
_________________________________
Aaron Aston | Twisted Pair | 905.852.0950