Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

CXF Client and WS-Addressing attributes

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello guys, I've been spending too many hours trying to find a solution but to no avail. I need to implement a client side code using CXF that invokes webservice asynchronously and sends ws-addressing values in the request, but the code I've created so far is not including them in the SOAP header.

Here's my client-side code:



The server-side code I have for testing purposes is the following:

CxfAdd.java:



CxfAddImpl.java:



When running my client-side code, in the server-side I get the following error:


INFO: Inbound Message
----------------------------
ID: 46
Address: http://localhost:8080/CxfAddressingServer/services/cxfadd
Encoding: UTF-8
Http-Method: POST
Content-Type: text/xml; charset=UTF-8
Headers: {Accept=[*/*], cache-control=[no-cache], connection=[keep-alive], Content-Length=[211], content-type=[text/xml; charset=UTF-8], host=[localhost:8080], pragma=[no-cache], SOAPAction=[""], user-agent=[Apache CXF 3.1.3]}
Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:myMethodOneWay xmlns:ns2="http://test.com/wsdl"><arg0>Input message</arg0></ns2:myMethodOneWay></soap:Body></soap:Envelope>
--------------------------------------
Out 30, 2015 7:18:56 PM org.apache.cxf.ws.addressing.ContextUtils retrieveMAPs
WARNING: WS-Addressing - failed to retrieve Message Addressing Properties from context



Can anyone enlighten me on this? Thank you.
 
Ranch Hand
Posts: 729
7
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

WARNING: WS-Addressing - failed to retrieve Message Addressing Properties from context


Firstly, just to note that it is a warning. It does not a priori mean the functionality server-side is broken resulting from the warning ... In fact, it is not uncommon that warning appears often in the log for some reason which could be obscur and could be safely ignored.

Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:myMethodOneWay xmlns:ns2="http://test.com/wsdl"><arg0>Input message</arg0></ns2:myMethodOneWay></soap:Body></soap:Envelope>


That could be the real concern. Functionality could break because of it ...

Your client-side code should at least make it clear that the addressing feature is registered with the port set up.

With that, your header should start to behave.
 
Monica Valverde
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It worked, thank you!
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic