You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by ychawla <pr...@yahoo.com> on 2011/05/04 17:12:56 UTC

CXF component with WS-Addressing and one way messages

Hello All,
I added WS Addressing to a CXF endpoint.  I did it up by updating the CXF
endpoint like this:

	<cxf:cxfEndpoint ....
	  >
	  <cxf:features>
	    <wsa:addressing/>
	  </cxf:features>
	</cxf:cxfEndpoint>

Initially I was fooling around with the CXF bus and referencing that on an
endpoint but the above method worked well.  Can I update the WIKI and add a
brief section on using 'cxf:features'?

When invoking the CXF endpoint, which is a one-way endpoint, I get this
exception:

WARNING: Interceptor for redacted has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Could not send Message.
	at
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:64)
	at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:244)
	at
org.apache.cxf.ws.addressing.ContextUtils.rebaseResponse(ContextUtils.java:383)
	at
org.apache.cxf.ws.addressing.MAPAggregator.mediate(MAPAggregator.java:506)
	at
org.apache.cxf.ws.addressing.MAPAggregator.handleMessage(MAPAggregator.java:188)
	at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:244)
	at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:110)
	at
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:311)
	at
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:275)
	at
org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:70)
	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
	at
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
	at org.mortbay.jetty.Server.handle(Server.java:326)
	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:536)
	at
org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:930)
	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:747)
	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:405)
	at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
	at
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
Caused by: java.io.IOException: Response object is null
	at
org.apache.cxf.transport.http.AbstractHTTPDestination.flushHeaders(AbstractHTTPDestination.java:560)
	at
org.apache.cxf.transport.http.AbstractHTTPDestination$WrappedOutputStream.close(AbstractHTTPDestination.java:653)
	at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
	at
org.apache.cxf.transport.http.AbstractHTTPDestination$BackChannelConduit.close(AbstractHTTPDestination.java:602)
	at
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
	... 20 more

Maybe I get this because CXF is trying to create a response message but
since it is a one-way method, no response exists.

I believe this is just a warning so it might simply be advisory, but did I
configure WS addressing incorrectly? 

Thanks,
Yogesh

--
View this message in context: http://camel.465427.n5.nabble.com/CXF-component-with-WS-Addressing-and-one-way-messages-tp4370106p4370106.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: CXF component with WS-Addressing and one way messages

Posted by ychawla <pr...@yahoo.com>.
Well,  this might not be an issues for the Camel mailing list.  I downloaded
cxf 2.4.0 and 2.2.12 and ran the WS Addressing samples distributed with them
and saw the same behavior.  I bumped this message over to the CXF mailing
list.

Thanks,
yogesh

--
View this message in context: http://camel.465427.n5.nabble.com/CXF-component-with-WS-Addressing-and-one-way-messages-tp4370106p4373076.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: CXF component with WS-Addressing and one way messages

Posted by ychawla <pr...@yahoo.com>.
An upgrade to version 2.2.12 corrected the exception, but brought up another
one...

I am calling a one-way service but a response is being sent back.  For
example:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
   <soap:Header>
      <MessageID
xmlns="http://www.w3.org/2005/08/addressing">urn:uuid:b8d0a8ca-ada1-4840-8722-a4859144726b</MessageID>
      <To
xmlns="http://www.w3.org/2005/08/addressing">http://www.w3.org/2005/08/addressing/anonymous</To>
      <ReplyTo xmlns="http://www.w3.org/2005/08/addressing">
         <Address>http://www.w3.org/2005/08/addressing/none</Address>
      </ReplyTo>
   </soap:Header>
   <soap:Body/>
</soap:Envelope>

Since this is a one-way method and annotated as such, I am wondering why
there is a reply.  Any ideas?

Thanks,
Yogesh

--
View this message in context: http://camel.465427.n5.nabble.com/CXF-component-with-WS-Addressing-and-one-way-messages-tp4370106p4371753.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: CXF component with WS-Addressing and one way messages

Posted by anton_nazarov <na...@telkom.co.za>.
Yogesh,

Thank you for the info! It should work.

regards,

Anton

--
View this message in context: http://camel.465427.n5.nabble.com/CXF-component-with-WS-Addressing-and-one-way-messages-tp4370106p4928987.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: CXF component with WS-Addressing and one way messages

Posted by ychawla <pr...@yahoo.com>.
Hi Anton,
Here is how you set the message ID:

		String requestID = "MY_MESSAGE_ID"
		
		if (StringUtils.isNotEmpty(requestID))
		{	
			// get Message Addressing Properties instance
	        AddressingBuilder builder =
AddressingBuilder.getAddressingBuilder();
	        AddressingProperties maps = builder.newAddressingProperties();
	
	        // set MessageID property
	        AttributedURIType messageIDAttr =
	            WSA_OBJECT_FACTORY.createAttributedURIType();
	        messageIDAttr.setValue(requestID);
	        maps.setMessageID(messageIDAttr);
			
	        Map<String, Object> requestContext = new HashMap<String, Object>();
	        requestContext.put(CLIENT_ADDRESSING_PROPERTIES, maps);
	        senderExchange.getIn().setHeader(Client.REQUEST_CONTEXT ,
requestContext);
		}   

Cheers,
Yogesh

--
View this message in context: http://camel.465427.n5.nabble.com/CXF-component-with-WS-Addressing-and-one-way-messages-tp4370106p4922223.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: CXF component with WS-Addressing and one way messages

Posted by anton_nazarov <na...@telkom.co.za>.
Hi All,

It seems that that post is closest one to the subject I want to ask.

I use WS-addressing with Camel-CXF component. I send a request to a web-
service (configured as <to ref="cxf:bean:...> endpoint).
I can see that by default the addressing header is included into my
SOAP-request. My task is to change/add some standard values in that
WS-addressing header. For example I need to set my own MessageID, not that
one which was generated for me by CXF automatically).

Please, throw some idea how to implement that in reliable way (the most
Camel-CXF- compliant way).


Thanks in advance,

regards,

Anton

--
View this message in context: http://camel.465427.n5.nabble.com/CXF-component-with-WS-Addressing-and-one-way-messages-tp4370106p4865074.html
Sent from the Camel - Users mailing list archive at Nabble.com.