Skip to main content

ws-addresing when action used messageid becomes mandatory

1 reply [Last post]
amountney
Offline
Joined: 2012-07-12
Points: 0

I'm getting an error using ws-addressing. It appears to expect that when ws-addressing Action header is used then MessageId becomes mandatory.

The ws-addressing spec says MessageId is mandatory when ReplyTo or FaultTo is being used but these are not in the request.

e.g.

Request:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:ns="urn://aaaa/"
xmlns:wsa5="http://www.w3.org/2005/08/addressing">
<soap:Header>
<wsa5:From><wsa5:Address>http://localhost:12801</wsa5:Address></wsa5:From>
<wsa5:To soap:mustUnderstand="true">http://localhost:8005/Simulator</wsa5:To>
<wsa5:Action soap:mustUnderstand="true">/BootNotification</wsa5:Action>
<ns:chargeBoxIdentity soap:mustUnderstand="true">REE001</ns:chargeBoxIdentity>
</soap:Header>
<soap:Body>
<ns:bootNotificationRequest>
</ns:bootNotificationRequest>
</soap:Body>
</soap:Envelope>

Response:
<S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope">
<S:Header>
<Action xmlns="http://www.w3.org/2005/08/addressing">http://www.w3.org/2005/08/addressing/fault</Action>
<MessageID xmlns="http://www.w3.org/2005/08/addressing">uuid:3c295bea-86fb-47e8-a1ae-86cea8bccc29</MessageID>
<To xmlns="http://www.w3.org/2005/08/addressing">http://www.w3.org/2005/08/addressing/anonymous</To>
</S:Header>
<S:Body>
<env:Fault xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<env:Code>
<env:Value>env:Sender</env:Value>
<env:Subcode>
<env:Value xmlns:wsa="http://www.w3.org/2005/08/addressing">wsa:MessageAddressingHeaderRequired</env:Value>
<env:Subcode>
<env:Value xmlns:wsa="http://www.w3.org/2005/08/addressing">wsa:MessageAddressingHeaderRequired</env:Value>
</env:Subcode>
</env:Subcode>
</env:Code>
<env:Reason>
<env:Text xml:lang="en-GB">A required header representing a Message Addressing Property is not present</env:Text>
</env:Reason>
<env:Detail>
<ns2:ProblemHeaderQName xmlns:ns2="http://www.w3.org/2005/08/addressing">ns2:MessageID</ns2:ProblemHeaderQName>
</env:Detail>
</env:Fault>
</S:Body>
</S:Envelope>

Stack:
12-Jul-2012 10:08:40 com.sun.xml.ws.addressing.WsaTube validateInboundHeaders
WARNING: A required header representing a Message Addressing Property is not present, Problem header:{http://www.w3.org/2005/08/addressing}MessageID
com.sun.xml.ws.addressing.model.MissingAddressingHeaderException: Missing WS-Addressing header: "{http://www.w3.org/2005/08/addressing}MessageID"
at com.sun.xml.ws.addressing.W3CWsaServerTube.checkMandatoryHeaders(W3CWsaServerTube.java:96)
at com.sun.xml.ws.addressing.WsaTube.checkCardinality(WsaTube.java:362)
at com.sun.xml.ws.addressing.WsaTube.checkMessageAddressingProperties(WsaTube.java:208)
at com.sun.xml.ws.addressing.WsaServerTube.checkMessageAddressingProperties(WsaServerTube.java:335)
at com.sun.xml.ws.addressing.WsaTube.validateInboundHeaders(WsaTube.java:165)
at com.sun.xml.ws.addressing.WsaServerTube.processRequest(WsaServerTube.java:175)
....

If wsa5:Action element is removed from the request it works ok.

I'm using 2.26u2. Is this a bug?

Thanks.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
ger_soto
Offline
Joined: 2012-12-05
Points: 0

The "Addressing" schema doesn't require to include elements such as "From" or "To", therefore, seems to be a bug in the schema-based message interpreter.

However, the server, which processes the request, is free to be strict, or not. One problem you may be experiencing is the "mustUnderstand" parameter on the label "To:", as in the server, if not processed, will fail te entire transaction, soy delete this attribute.

Do not lose perspective of the WSDL when you are trying to process, which is the parent of all other namespaces that are involved. At this schema, it only forces using wsa5:Action , not more.

Just out of curiosity ¿Which brand are you integrating?