Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] REST service proxy route

Hello!
Using Talend ESB, I want to proxy my REST service that is deployed, for example, on: http://hostnameA:8080/web_app to http://hostnameB:8085/web_app. That means, when I want to invoke the service (http://hostnameA:8080/web_app), I need to invoke them on: http://hostnameB:8085/web_app. It is just a simple proxy route.
I tried to do this using TOS and Talend ESB Studio, but without result. I tried something similar with Axis web services and works fine. My configuration for this case was:
Part of camel-config.xml file



address="http://proxy_hostname:8090/application/service/TokenService"
endpointName="s0683p000009M9p6.pngervice"
serviceName="s:TokenService"
wsdlURL="etc/TokenService.wsdl"
xmlns:s="http://tempo.intalio.org/security/tokenService/"/>


serviceName="serviceNS:TokenService"
endpointName="serviceNS0683p000009M9p6.pngervice" address="http://hostname:8080/axis2/services/TokenService">

....









Can someone help me?
Thanks in advance!

Labels (1)
  • Other

27 Replies
Anonymous
Not applicable
Author

Can anyboby, please help me?
Anonymous
Not applicable
Author

Hi,
Can you give us a little bit more details on what is not working actually ?
Thanks,
Bahaaldine
Anonymous
Not applicable
Author

Hi,
I have a REST service deployed on http://hostname:8080/alfresco/service/service_name/process/{instanceId}/doctypes/{doctype} with,as you can see, 2 parameters. I want to publish this service on Talend ESB and proxy them on different hostname and (or) port.
I've tried with a job that call this service using the tREST component, exported them as an OSGi bundle for ESB and deployed on ESB. When I invoke them with "job:start job_name" command it works fine. Shows the expected response (link in string format). I think this is not a right solution to proxy a REST service.
How can I invoke this job remotely from another application? Is there any other better solutions to proxy a REST service using Talend ESB? Can I use the Route Builder within Talend ESB Studio to create a simple proxy route? If yes, how? Is there any example?
Thanks
Anonymous
Not applicable
Author

Hi
You can probably just use simpler Camel HTTP or Jetty components for a simple proxying.
I'm not sure if you can use CXF components in the from: mode when WSDL2 is used to describe a RESTful endpoint.
Alternatively please also consider using to:cxfrs:uri, instead of just to:uri, though to:uri should work, the problem seems to be on the from: end
Anonymous
Not applicable
Author

Hi,
I think you can do it directly on the RouteBuilder :
- Create a cMessagingEndpoint, set the URI as follow :
"cxf://http://KarafHostName:KarafPort/webserviceEndpoint?wsdlURL=file:///pathToMyWSDL/file.wsdl&dataFormat=MESSAGE"
This messaging endpoint is the proxy service entry point.
- Create a cMessagingEndpoint, set the URI to your REST Web service :
"cxf://http://RESTHostName:RestPortt/RestWebserviceEndpoint?dataFormat=MESSAGE"

Connect the two cMessagingEndpoint and run.

Bahaaldine
Anonymous
Not applicable
Author

@ bahaaldine: if using TESB 4.2.0, maybe a patch about CXF is needed to make the Route work. And in the next release of TESB, Route with CXF will run without any workaround.
Anonymous
Not applicable
Author

Hi bahaaldine,
should I implement a service and write a WSDL for my REST service which I will expose on ESB or? I don't understand.
I tried with this configuration:
First cMessagingEndpoint:
"cxf://http://localhost:18081/applicationName/service/serviceName/process?dataFormat=MESSAGE"
Second cMessagingEndpoint:
"cxf://http://mashina:8080/applicationName/service/serviceName/process?dataFormat=MESSAGE"
The error I get is: "Failed to create route cMessagingEndpoint_1: Route[[From[cxf://http://localhost:18081/alfresco/service/ab... because of Failed to resolve endpoint: cxf://http://localhost:18081/alfresco/service/abitecm/process?dataFormat=MESSAGE due to: No component found with scheme: cxf" (Error within Talend Route Builder when I press Run)
Then I have tried without "cxf" prefix in uri. No errors.
When I invoke the endpoint: http://localhost:18081/applicationName/service/serviceName/process/{parameter1}/doctypes/{parameter2}
nothing happens (Firefox REST client)
KarafHostName: localhost
KarafPort: 18081
I deployed the route on Talend ESB and invoked again the endpoint. The error I get then is:
"

<META http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" />
<TITLE>Error 404 Not Found</TITLE>


HTTP ERROR: 404

Problem accessing /applicationName/service/serviceName/process/28/doctypes/doctypeName. Reason:

    Not Found



<SMALL>Powered by Jetty://</SMALL>"
I do not know if I have well explained what I need?!
Anonymous
Not applicable
Author

Hi,
I want to have this functionality for the REST service using Talend ESB:
http://www.mulesoft.org/web-service-proxy
Anonymous
Not applicable
Author

Hi,
can anyone help me to solve this problem? I have a deadline next Monday.
I have tried various solutions like:
http://camel.apache.org/cxfrs.html
http://camel.apache.org/http.html
but without result 😞