You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by madusanka <ma...@gmail.com> on 2013/11/12 17:52:10 UTC
How to expose a remote Web Service
Hi,
I want to expose a remote web service in Camel using <cxf:cxfEndpoint>. But
the remote web service is written in Axis2. Is this possible or if not, How
can I expose a remote Axis2 web service in
ServiceMix ??
Thank you !!!
--
View this message in context: http://camel.465427.n5.nabble.com/How-to-expose-a-remote-Web-Service-tp5743119.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: How to expose a remote Web Service
Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Nov 12, 2013 at 6:00 PM, madusanka
<ma...@gmail.com> wrote:
> Hi,
>
> So is there any way I can expose an Axis2 Web Service in Apache Camel ?
>
No there is no Axis component for Camel.
You can just use Axis2 as normal, and if call Camel from your Axis2 web service.
Here is an old example of using Axis 1.4 with Camel
http://camel.apache.org/tutorial-axis-camel.html
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-to-expose-a-remote-Web-Service-tp5743119p5743121.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Re: How to expose a remote Web Service
Posted by madusanka <ma...@gmail.com>.
Hi,
Following is my camel-context.xml file. "HelloServiceEndpoint" is the actual
remote web service implementation. "proxyEndpoint" is the front end accessed
by clients.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cxf="http://camel.apache.org/schema/cxf"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://camel.apache.org/schema/cxf
http://camel.apache.org/schema/cxf/camel-cxf.xsd
http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd">
<cxf:cxfEndpoint id="proxyEndpoint"
address="http://localhost:8080/HelloService"
wsdlURL="../../wsdl/HelloService.wsdl"
endpointName="tns:HelloServicePort"
serviceName="tns:HelloService"
xmlns:tns="http://tempuri.org/HelloService" />
<camelContext xmlns="http://camel.apache.org/schema/spring">
<endpoint id="HelloServiceEndpoint"
uri="http://localhost:8080/axis2/services/HelloService"/>
<route>
<from uri="cxf:bean:proxyEndpoint" />
<to ref="HelloServiceEndpoint"/>
</route>
</camelContext>
</beans>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
When I deploy it in ServiceMix 4.5.2, I get the following exception. Please
help me to solve this.
2013-11-13 14:03:30,381 | ERROR | xtenderThread-32 | ContextLoaderListener
| 82 - org.springframework.osgi.extender - 1.2.1 | Application context
refresh failed (OsgiBundleXmlApplicationContext(bundle=HelloSerice,
config=osgibundle:/META-INF/spring/*.xml))
org.apache.camel.RuntimeCamelException:
org.apache.camel.FailedToCreateRouteException: Failed to create route
route16 at: >>> To[ref:HelloServiceEndpoint] <<< in route:
Route[[From[cxf:bean:proxyEndpoint]] -> [To[ref:HelloService... because of
Cannot lookup: HelloServiceEndpoint from registry:
org.apache.camel.spring.spi.ApplicationContextRegistry@ef152b with expected
type: interface org.apache.camel.Endpoint due: Error creating bean with name
'HelloServiceEndpoint': FactoryBean threw exception on object creation;
nested exception is org.apache.camel.ResolveEndpointFailedException: Failed
to resolve endpoint: http://localhost:8080/axis2/services/HelloService due
to: No component found with scheme: http
at
org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1326)[100:org.apache.camel.camel-core:2.10.6]
--
View this message in context: http://camel.465427.n5.nabble.com/How-to-expose-a-remote-Web-Service-tp5743119p5743159.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: How to expose a remote Web Service
Posted by Willem jiang <wi...@gmail.com>.
The proxyEndpoint means you want some client to access this proxy, so you can chose the address that you want to expose.
But you need to access the real back end service (the Axis2 service), as camel-cxf endpoint turn the request into method call with parameters by default, you need to use camel-cxf endpoint to send the request this time.
--
Willem Jiang
Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang
Weibo: 姜宁willem
On Wednesday, November 13, 2013 at 1:51 AM, madusanka wrote:
> Hi,
>
> Thanks a lot!!!. I don't want to run Axis2 service in Camel. I have an
> existing web service someplace and I want to create a proxy in front of it.
> Following is my proxy configuration. For "proxyEndpoint" can I use any URL
> of my choice or is there a specific one?
>
>
> <cxf:cxfEndpoint id="proxyEndpoint"
> address="http://localhost:8080/HelloService"
> wsdlURL="../../wsdl/HelloService.wsdl"
> endpointName="tns:HelloServicePort"
> serviceName="tns:HelloService"
> xmlns:tns="http://tempuri.org/HelloService" />
>
>
> <camelContext xmlns="http://camel.apache.org/schema/spring">
>
> <endpoint id="HelloServiceEndpoint"
> uri="http://localhost:8080/axis2/services/HelloService"/>
> <route>
> <from uri="cxf:bean:proxyEndpoint" />
> <to ref="HelloServiceEndpoint"/>
> </route>
> </camelContext>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-to-expose-a-remote-Web-Service-tp5743119p5743125.html
> Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: How to expose a remote Web Service
Posted by madusanka <ma...@gmail.com>.
Hi,
Thanks a lot!!!. I don't want to run Axis2 service in Camel. I have an
existing web service someplace and I want to create a proxy in front of it.
Following is my proxy configuration. For "proxyEndpoint" can I use any URL
of my choice or is there a specific one?
<cxf:cxfEndpoint id="proxyEndpoint"
address="http://localhost:8080/HelloService"
wsdlURL="../../wsdl/HelloService.wsdl"
endpointName="tns:HelloServicePort"
serviceName="tns:HelloService"
xmlns:tns="http://tempuri.org/HelloService" />
<camelContext xmlns="http://camel.apache.org/schema/spring">
<endpoint id="HelloServiceEndpoint"
uri="http://localhost:8080/axis2/services/HelloService"/>
<route>
<from uri="cxf:bean:proxyEndpoint" />
<to ref="HelloServiceEndpoint"/>
</route>
</camelContext>
--
View this message in context: http://camel.465427.n5.nabble.com/How-to-expose-a-remote-Web-Service-tp5743119p5743125.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: How to expose a remote Web Service
Posted by Daniel Kulp <dk...@apache.org>.
On Nov 12, 2013, at 12:00 PM, madusanka <ma...@gmail.com> wrote:
> Hi,
>
> So is there any way I can expose an Axis2 Web Service in Apache Camel ?
Depends on what you are trying to do really. If you have an existing web service someplace (doesn’t matter what it’s using to implement it) and you want to create some sort of route to it or some sort of proxy in front of it, you can easily do that with Camel using a variety of possible components including the CXF component, soap component, etc…
If you actually want to run the Axis2 service in Camel and have Camel route to it directly, that wouldn’t be possible right now. However, that’s not a “normal” case I think. Most of the time, you already have an Axis2 service running and you just need to proxy over it or route information to it in which case the capabilities of Camel already should be fine.
--
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com
Re: How to expose a remote Web Service
Posted by madusanka <ma...@gmail.com>.
Hi,
So is there any way I can expose an Axis2 Web Service in Apache Camel ?
--
View this message in context: http://camel.465427.n5.nabble.com/How-to-expose-a-remote-Web-Service-tp5743119p5743121.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: How to expose a remote Web Service
Posted by Claus Ibsen <cl...@gmail.com>.
<cxf:cxfEndpoint> is using Apache CXF, so you cannot use that.
On Tue, Nov 12, 2013 at 5:52 PM, madusanka
<ma...@gmail.com> wrote:
> Hi,
>
> I want to expose a remote web service in Camel using <cxf:cxfEndpoint>. But
> the remote web service is written in Axis2. Is this possible or if not, How
> can I expose a remote Axis2 web service in
> ServiceMix ??
>
> Thank you !!!
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-to-expose-a-remote-Web-Service-tp5743119.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen