You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "varun singhal (JIRA)" <ji...@apache.org> on 2018/11/20 05:59:00 UTC

[jira] [Updated] (CXF-7904) [Migrating to CXF 3.2.7] : Receving "A required header representing a Message Addressing Property is not present" during SOAP RQ processing

     [ https://issues.apache.org/jira/browse/CXF-7904?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

varun singhal updated CXF-7904:
-------------------------------
    Description: 
Hello team,

Greetings :)

*Context :* 
 Migration of webservice from CXF 2.2.2 to CXF 3.2.7

*Problem :* 
 CXF is throwing "A required header representing a Message Addressing Property is not present" while processing the below RQ :

*SOAP RQ :*
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope 
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" 
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurityutility-1.0.xsd" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" 
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<wsse:Security soap:mustUnderstand="1">
<wsse:UsernameToken wsu:Id="">
<wsse:Username>sampleUser</wsse:Username>
<wsse:Password>samplePassword</wsse:Password>
<wsse:PartnerID>samplePartner</wsse:PartnerID>
</wsse:UsernameToken>
</wsse:Security>
<wsa:To>https://samplewebservice.com/samplews</wsa:To>
<wsa:Action>https://samplewebservice.com/samplews/htng</wsa:Action>
<wsa:From>
<wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address>
<wsa:Reference/>
</wsa:From>
</soap:Header>
<soap:Body>
</soap:Body>
</soap:Envelope>

Th exception thrown is

*Exception* :
 {{10:40:34,475 WARNING [org.apache.cxf.phase.PhaseInterceptorChain] (http-127.0.0.1:8080-1) Interceptor for \{webservice URL}invoke has thrown exception, unwinding now: org.apache.cxf.binding.soap.SoapFault: {color:#ff0000}A required header representing a Message Addressing Property is not present {color}}}
 Logs attached.[^Logs.txt]

*Root cause :* 
 The root cause of this issue is that _<wsa:MessageID>_ is missing in SOAP header, after inserting it, the RQ is processed successfully.

*Question :* 
 The wsa specs ([https://www.w3.org/Submission/ws-addressing/]) advise that _<wsa:MessageID>_ is mandatory only when _<wsa:ReplyTo>_ or _<wsa:FaultTo>_ is present
 In the above RQ there is no _<wsa:ReplyTo>_ or _<wsa:FaultTo>_ thus _<wsa:MessageID>_ should be optional, then could you advise why CXF is validating it as mandatory and throwing exception in SOAP RQ processing ?

Surprisingly*, the very same request works in CXF 2.2.2.*

 if this is correct behaviour then can you please suggest a workaround as it will be very diffcult to ask all consumers of our webservice to start sending this tag.

Many thanks for your kind help !

  was:
Hello team,

Greetings :-)

*Context :* 
Migration of webservice from CXF 2.2.2 to CXF 3.2.7

*Problem :* 
CXF is throwing "A required header representing a Message Addressing Property is not present" while processing the below RQ :

*SOAP RQ :*
{{<?xml version="1.0" encoding="UTF-8"?> <soap:Envelope xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurityutility-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Header> <wsse:Security soap:mustUnderstand="1"> <wsse:UsernameToken wsu:Id=""> <wsse:Username>sampleUser</wsse:Username> <wsse:Password>samplePassword</wsse:Password> <wsse:PartnerID>samplePartner</wsse:PartnerID> </wsse:UsernameToken> </wsse:Security> <wsa:To>https://samplewebservice.com/samplews</wsa:To> <wsa:Action>https://samplewebservice.com/samplews/htng</wsa:Action> <wsa:From> <wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address> <wsa:Reference/> </wsa:From> </soap:Header> <soap:Body> </soap:Body> </soap:Envelope>}}

Th exception thrown is

*Exception* :
{{10:40:34,475 WARNING [org.apache.cxf.phase.PhaseInterceptorChain] (http-127.0.0.1:8080-1) Interceptor for \{webservice URL}invoke has thrown exception, unwinding now: org.apache.cxf.binding.soap.SoapFault: {color:#FF0000}A required header representing a Message Addressing Property is not present {color}}}
Logs attached.[^Logs.txt]


*Root cause :* 
The root cause of this issue is that _<wsa:MessageID>_ is missing in SOAP header, after inserting it, the RQ is processed successfully.

*Question :* 
The wsa specs (https://www.w3.org/Submission/ws-addressing/) advise that _<wsa:MessageID>_ is mandatory only when _<wsa:ReplyTo>_ or _<wsa:FaultTo>_ is present
In the above RQ there is no _<wsa:ReplyTo>_ or _<wsa:FaultTo>_ thus _<wsa:MessageID>_ should be optional, then could you advise why CXF is validating it as mandatory and throwing exception in SOAP RQ processing ?

Surprisingly*, the very same request works in CXF 2.2.2.*

 if this is correct behaviour then can you please suggest a workaround as it will be very diffcult to ask all consumers of our webservice to start sending this tag.

Many thanks for your kind help !


> [Migrating to CXF 3.2.7] : Receving "A required header representing a Message Addressing Property is not present" during SOAP RQ processing
> -------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-7904
>                 URL: https://issues.apache.org/jira/browse/CXF-7904
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 3.2.7
>            Reporter: varun singhal
>            Priority: Major
>         Attachments: Logs.txt
>
>
> Hello team,
> Greetings :)
> *Context :* 
>  Migration of webservice from CXF 2.2.2 to CXF 3.2.7
> *Problem :* 
>  CXF is throwing "A required header representing a Message Addressing Property is not present" while processing the below RQ :
> *SOAP RQ :*
> <?xml version="1.0" encoding="UTF-8"?>
> <soap:Envelope 
> xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" 
> xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurityutility-1.0.xsd" 
> xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
> xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" 
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
> <soap:Header>
> <wsse:Security soap:mustUnderstand="1">
> <wsse:UsernameToken wsu:Id="">
> <wsse:Username>sampleUser</wsse:Username>
> <wsse:Password>samplePassword</wsse:Password>
> <wsse:PartnerID>samplePartner</wsse:PartnerID>
> </wsse:UsernameToken>
> </wsse:Security>
> <wsa:To>https://samplewebservice.com/samplews</wsa:To>
> <wsa:Action>https://samplewebservice.com/samplews/htng</wsa:Action>
> <wsa:From>
> <wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address>
> <wsa:Reference/>
> </wsa:From>
> </soap:Header>
> <soap:Body>
> </soap:Body>
> </soap:Envelope>
> Th exception thrown is
> *Exception* :
>  {{10:40:34,475 WARNING [org.apache.cxf.phase.PhaseInterceptorChain] (http-127.0.0.1:8080-1) Interceptor for \{webservice URL}invoke has thrown exception, unwinding now: org.apache.cxf.binding.soap.SoapFault: {color:#ff0000}A required header representing a Message Addressing Property is not present {color}}}
>  Logs attached.[^Logs.txt]
> *Root cause :* 
>  The root cause of this issue is that _<wsa:MessageID>_ is missing in SOAP header, after inserting it, the RQ is processed successfully.
> *Question :* 
>  The wsa specs ([https://www.w3.org/Submission/ws-addressing/]) advise that _<wsa:MessageID>_ is mandatory only when _<wsa:ReplyTo>_ or _<wsa:FaultTo>_ is present
>  In the above RQ there is no _<wsa:ReplyTo>_ or _<wsa:FaultTo>_ thus _<wsa:MessageID>_ should be optional, then could you advise why CXF is validating it as mandatory and throwing exception in SOAP RQ processing ?
> Surprisingly*, the very same request works in CXF 2.2.2.*
>  if this is correct behaviour then can you please suggest a workaround as it will be very diffcult to ask all consumers of our webservice to start sending this tag.
> Many thanks for your kind help !



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)