Forum Home » Fuse Distributions » Fuse ESB

Thread: How to configure external web service as service endpoint in FUSE

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


Permlink Replies: 6 - Last Post: Jun 20, 2012 1:52 AM Last Post By: njiang Threads: [ Previous | Next ]
sarfarajsayyad

Posts: 6
Registered: 06/07/12
How to configure external web service as service endpoint in FUSE
Posted: Jun 19, 2012 5:31 AM
 
  Click to reply to this thread Reply
I am newbie to Fuse ESB. I need to demo external web service as service endpoint in FUSE.

Following are the things I need to demo.
1) I Have 2 sample cxf web services running on Apache tomcat (apache-tomcat-7.0.23).
Which is accepting string as a input and return the same with some additional string.

2) One of the web service (say sourceWebSvc) is one endpoint(entry) in Fuse ESB which accept the string from SOAP UI.

3) Add one filter on that particular string for some condition and passed that string finally to next endpoint which is another web service (Say targetWebSvc). and print that output to console/log.

Please give me some sample/suggestions on the same.

FYI: my web service address
http://localhost:8080/sourcews/services/testSourceWebService
http://localhost:8080/targetws/services/testTargetWebService

Thanks
/Sarfaraj
davsclaus

Posts: 1,893
Registered: 10/14/08
Re: How to configure external web service as service endpoint in FUSE
Posted: Jun 19, 2012 8:59 AM   in response to: sarfarajsayyad in response to: sarfarajsayyad
 
  Click to reply to this thread Reply
Hi

You may want to read the CXF proxy example
http://camel.apache.org/cxf-proxy-example.html

There are numerous ways of doing this. But this example should get you started.
sarfarajsayyad

Posts: 6
Registered: 06/07/12
Re: How to configure external web service as service endpoint in FUSE
Posted: Jun 19, 2012 11:19 AM   in response to: sarfarajsayyad in response to: sarfarajsayyad
 
  Click to reply to this thread Reply
I did as follows

<camelContext xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="cxf://http://localhost:8080/sourcews/services/testSourceWebService?wsdlURL=src/etc/testSourceWebService.wsdl&amp;dataFormat=MESSAGE"/>
<log loggingLevel="INFO" message="&gt;&gt;&gt; ${body}"/>
<to uri="cxf://http://localhost:8080/targetws/services/testTargetService?wsdlURL=src/etc/testTargetService.wsdl&amp;dataFormat=MESSAGE"/>
<log loggingLevel="INFO" message="&gt;&gt;&gt; ${body}"/>
</route>
</camelContext>

but not solved my problem. Can somebody point/correct me?
davsclaus

Posts: 1,893
Registered: 10/14/08
Re: How to configure external web service as service endpoint in FUSE
Posted: Jun 19, 2012 11:38 AM   in response to: sarfarajsayyad in response to: sarfarajsayyad
 
  Click to reply to this thread Reply
In the <to> use <to uri="http:/xxx"> instead so you do a plain HTTP call, as your message is already a SOAP message.
sarfarajsayyad

Posts: 6
Registered: 06/07/12
Re: How to configure external web service as service endpoint in FUSE
Posted: Jun 19, 2012 11:50 AM   in response to: davsclaus in response to: davsclaus
 
  Click to reply to this thread Reply
like

<to uri="http://localhost:8080/targetws/services/testTargetService"/>

?

It gives me

Failed to create route route1 at: >>> Tohttp://localhost:8080/targetws/services/testTargetService <<< in route: Route[[From[cxf://http://localhost:8080/sourcews/services/te... because of Failed to resolve endpoint: http://localhost:8080/targetws/services/testTargetService due to: No component found with scheme: http

FYI: Both web services are external (running on tomcat)

Edited by: sarfarajsayyad on Jun 19, 2012 11:51 AM
sarfarajsayyad

Posts: 6
Registered: 06/07/12
Re: How to configure external web service as service endpoint in FUSE
Posted: Jun 19, 2012 12:37 PM   in response to: davsclaus in response to: davsclaus
 
  Click to reply to this thread Reply
After adding

<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-http</artifactId>
<version>2.9.0.fuse-7-061</version>
</dependency>

The error message gone, but run time i got

ERROR Failed delivery for (MessageId: ID-XXXXX-WS01-55740-1333283117556-0-2 on ExchangeId: ID-SASAYYAD-WS01-55740-1333283117556-0-1). Exhausted after delivery attempt: 1 caught: org.apache.camel.component.http.HttpOperationFailedException: HTTP operation failed invoking http://localhost:8080/targetws/services/testTargetService with statusCode: 404
org.apache.camel.component.http.HttpOperationFailedException: HTTP operation failed invoking http://localhost:8080/tar

njiang

Posts: 572
Registered: 09/17/07
Re: How to configure external web service as service endpoint in FUSE
Posted: Jun 20, 2012 1:52 AM   in response to: sarfarajsayyad in response to: sarfarajsayyad
 
  Click to reply to this thread Reply
Can you double check if you start the real back end service which listen to the address of "http://localhost:8080/targetws/services/testTargetService"?

Willem