Forum Home » Fuse Distributions » Fuse ESB

Thread: Stax exception while trying route SOAP HTTP request via ESB to JMS

 
This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 8 - Last Post: Dec 20, 2010 1:31 AM Last Post By: njiang
baliganaresh1

Posts: 21
Registered: 12/02/10
Stax exception while trying route SOAP HTTP request via ESB to JMS
Posted: Dec 15, 2010 5:14 PM
 
  Click to reply to this thread Reply
Attachment error.txt (9.2 KB)
Hello,
I am attempting to send a SOAP HTTP request via Fuse4 ESB to a JMS queue where it has to be received and a reply has to be sent back to the HTTP Request.

Currently, I'm seeing an exception as below when I send in a SOAP Http request:

org.apache.servicemix.soap.api.Fault: javax.xml.stream.XMLStreamException: Can not create Stax reader for the Source passed .. neither reader, input stream nor system id was accessible; can not use other types of sources (like embedded SAX streams)
at org.apache.servicemix.soap.util.stax.StaxUtil.createReader(StaxUtil.java:78)139:servicemix-soap2:2010.02.0.fuse-01-00
...

I have an HTTP consumer endpoint configured as below:
<http:endpoint service="test:ConsumerService"
endpoint="HelloWorldPort"
role="consumer"
targetService="test:HelloWorldService"
locationURI="http://localhost:8192/consumerservice"
defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
soap="true" />

and a JMS Provider endpoint configured as below:
<jms:soap-provider service="test:HelloWorldService"
endpoint="HelloWorldPort"
destinationName="transport.bridge.queue"
wsdl="classpath:HelloWorld.wsdl"
validateWsdl="false"
connectionFactory="#connectionFactory" />

Since I've goofed up before on my WSDL, I set up a HTTP Provider and used it instead of the JMS endpoint as a targetService. I had a Web service running on Tomcat separately and the HTTP Provider was able to route the request to the remote web service and return the reply back to the originating HTTP request.

So it's not an issue with the WSDL, I think. As soon as I plug in the JMS Provider endpoint as the targetService for the HTTP SOAP Consumer endpoint, I get this issue.

The complete stack trace is attached to this message.

Any pointers?

Thanks.
baliganaresh1

Posts: 21
Registered: 12/02/10
Re: Stax exception while trying route SOAP HTTP request via ESB to JMS
Posted: Dec 16, 2010 2:43 PM   in response to: baliganaresh1 in response to: baliganaresh1
 
  Click to reply to this thread Reply
Anybody?

I guess the bigger picture here is that I am trying to consume a SOAP over HTTP request via the ESB and have it directed to a JMS queue. The reply is to be put back on the queue and routed back to the HTTP client.

I have been able to get this to work with a plain HTTP request, but am struggling with the SOAP version.

So alternatively, if there is an example out there that accomplishes this, I would appreciate a link to it.

Thanks.
baliganaresh1

Posts: 21
Registered: 12/02/10
Re: Stax exception while trying route SOAP HTTP request via ESB to JMS
Posted: Dec 16, 2010 2:44 PM   in response to: baliganaresh1 in response to: baliganaresh1
 
  Click to reply to this thread Reply
Anybody?

I guess the bigger picture here is that I am trying to consume a SOAP over HTTP request via the ESB and have it directed to a JMS queue. The reply is to be put back on the queue and routed back to the HTTP client.

I have been able to get this to work with a plain HTTP request, but am struggling with the SOAP version.

So alternatively, if there is an example out there that accomplishes this, I would appreciate a link to it.

Thanks.
ffang

Posts: 1,320
Registered: 12/24/07
Re: Stax exception while trying route SOAP HTTP request via ESB to JMS
Posted: Dec 17, 2010 4:23 AM   in response to: baliganaresh1 in response to: baliganaresh1
 
  Click to reply to this thread Reply
Hi,

May I ask did you put the jms reply back through the queue? If so, how?

Freeman
baliganaresh1

Posts: 21
Registered: 12/02/10
Re: Stax exception while trying route SOAP HTTP request via ESB to JMS
Posted: Dec 17, 2010 4:48 AM   in response to: ffang in response to: ffang
 
  Click to reply to this thread Reply
No, I am not getting to the point where I can dequeue and do a reply.

The SOAP message doesn't make it to the JMS queue at all. I believe the exception is being thrown when Fuse4 ESB makes an attempt to send the SOAP message to the JMS provider endpoint.
njiang

Posts: 572
Registered: 09/17/07
Re: Stax exception while trying route SOAP HTTP request via ESB to JMS
Posted: Dec 18, 2010 9:19 AM   in response to: baliganaresh1 in response to: baliganaresh1
 
  Click to reply to this thread Reply
Maybe you can take a the first example of Camel CXF Examples[1].
[1]http://camel.apache.org/cxf-example.html

It's total different solution, and Fuse ESB support it out of box :)

Willem
baliganaresh1

Posts: 21
Registered: 12/02/10
Re: Stax exception while trying route SOAP HTTP request via ESB to JMS
Posted: Dec 18, 2010 5:02 PM   in response to: njiang in response to: njiang
 
  Click to reply to this thread Reply
I'm assuming that for my issue, the first section in that example, "CXF example for routing messages with different transports", is what I should pay attention to?

If so, I don't grasp how that is different from what I'm doing? I mean the route building doesn't seem to be an issue in my case.

The ROUTER_ENDPOINT_URI and SERVICE_ENDPOINT_URI are my HTTP consumer and JMS Provider endpoints respectively.
baliganaresh1

Posts: 21
Registered: 12/02/10
Re: Stax exception while trying route SOAP HTTP request via ESB to JMS
Posted: Dec 18, 2010 6:25 PM   in response to: baliganaresh1 in response to: baliganaresh1
 
  Click to reply to this thread Reply
And of course, the transport being used to and from the endpoints, is the ESB's NMR.
njiang

Posts: 572
Registered: 09/17/07
Re: Stax exception while trying route SOAP HTTP request via ESB to JMS
Posted: Dec 20, 2010 1:31 AM   in response to: baliganaresh1 in response to: baliganaresh1
 
  Click to reply to this thread Reply
The difference is the CXF example just uses the http transport and jms transport from the CXF lib instead of ServiceMix JBI component.
So it may help you work around the Stax exception.

Willem