You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Stephane <st...@horoquartz.fr> on 2011/12/01 12:48:29 UTC

Call an external Web Service in apache-servicemix-4.3.0-fuse-00-00

Hello,

I'm a newbie in ServiceMix and I'm trying to call an external Web Service
from ServiceMix. I read a lot of post and I can't configure my xbean.xml and
my camel-context.xml for call the external web service.

So, my entry point is a HTTP Consumer. From this point, I want to call an
external Web Service.

I have configured a cxfbc like this :

<beans 	xmlns:cxfbc="http://servicemix.apache.org/cxfbc/1.0"
		xmlns:dataExchange="http://webServices.web.squirel.horoquartz.amano.com/">

	<import resource="classpath:META-INF/cxf/cxf.xml" />
	<import resource="classpath:META-INF/cxf/cxf-extension-http.xml" />
	<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
	<import resource="classpath:META-INF/cxf/cxf-extension-http-binding.xml" />
	<import resource="classpath:META-INF/cxf/cxf-extension-http-jetty.xml" />	
		
	<cxfbc:provider
wsdl="http://localhost:8080/EasyID/services/HQCloudWebService?wsdl"
		service="dataExchange:HQCloudWebServiceService"
		endpoint="applicationConsCxf">
	</cxfbc:provider>
</beans>

When my HTTP Consumer has my cxfbc for target, I have the error : Premature
end of file

After, I try to do something like this :

HTTP Consumer -> Camel Router -> Cxfbc

If I do that, my error is No endpoint, service or interface name specified
for routing
My route is 

<route>
<convertBodyTo type="java.lang.String"/>
<from
uri="jbi:endpoint:http://servicemix.apache.org/router/DataExchange/call4"/>
<to
uri="jbi:service:http://webServices.web.squirel.horoquartz.amano.com/HQCloudWebServiceService"/>
</route>

After, I try to use cxf endpoint from Camel with a route like this :

<route>
<convertBodyTo type="java.lang.String"/>
<from
uri="jbi:endpoint:http://servicemix.apache.org/router/DataExchange/call3"/>
<to uri="cxf:bean:customerService"/>
</route>

But I get the error No component found with scheme: cxf
If i had these imports, I have the same error

<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-http.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-http-jetty.xml" />

Also, I try to make a Camel bean which call my external Web Service, but I
have the error :

No conduit initiator was found for the namespace
http://schemas.xmlsoap.org/soap/http

So, what is my problem, because I don't understand how can I call a external
Web Service and what is the good solution.

Thanks for your help

Stephane

--
View this message in context: http://servicemix.396122.n5.nabble.com/Call-an-external-Web-Service-in-apache-servicemix-4-3-0-fuse-00-00-tp5038418p5038418.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: Call an external Web Service in apache-servicemix-4.3.0-fuse-00-00

Posted by Gnanaguru S <gn...@wipro.com>.
Hi ,

You may get some idea from this. It was working. 


<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:camel="http://camel.apache.org/schema/spring"
       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/spring
http://camel.apache.org/schema/spring/camel-spring.xsd
       http://camel.apache.org/schema/cxf
http://camel.apache.org/schema/cxf/camel-cxf.xsd">

  <import resource="classpath:META-INF/cxf/cxf.xml"/>
  <cxf:cxfEndpoint id="cxfIncidentEnpoint"
                   address="http://localhost:9090/IncidentService"
                   serviceName="s:IncidentService"
                   wsdlURL="etc/IncidentServiceSoap.wsdl"
                   xmlns:s="http://dummy/schema/ServiceRequest"
                   />

  
  <camelContext xmlns="http://camel.apache.org/schema/spring">
<route>
      	 <from uri="cxf:bean:cxfIncidentEnpoint?dataFormat=MESSAGE"/>
         <to uri="file://inputdir/"/>
         <log loggingLevel="INFO" message="&gt;&gt;&gt; ${body}"/>

</route>
<route>    
         <from uri="file://inputdir/"/>
        <to uri="file://inputdir2/"/>
         
</route>
<route>

         <from uri="file://inputdir2/"/>
	 <to uri="http://10.200.14.164:8080/CalculatorApp/CalculatorWSService"/>
         <to uri="file://outputdir/"/>
         <log loggingLevel="INFO" message="&gt;&gt;&gt; ${body}"/>

</route> 
  </camelContext>
</beans>

You might get a good idea from it. I got it working. 


Regards
Guru


-----
Cheers
 Guru
--
View this message in context: http://servicemix.396122.n5.nabble.com/Call-an-external-Web-Service-in-apache-servicemix-4-3-0-fuse-00-00-tp5038418p5054779.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: Call an external Web Service in apache-servicemix-4.3.0-fuse-00-00

Posted by Freeman Fang <fr...@gmail.com>.
As users are using Fuse ESB kit, so we've also discussed this issue  
here[1], just post the link for other guys if encounter similar issues.

[1]http://fusesource.com/forums/thread.jspa?threadID=3541

Freeman
On 2011-12-5, at 下午7:39, Stephane wrote:

> After add a camel cxf:cxfEndpoint, I have this exception when  
> serviceMix
> start :
>
> javax.jbi.management.DeploymentException: <component-task-result
> xmlns="http://java.sun.com/xml/ns/jbi/management-message">
> 	<component-name>servicemix-camel</component-name>
> 	<component-task-result-details>
> 		<task-result-details>
> 			<task-id>deploy</task-id>
> 			<task-result>FAILED</task-result>
> 			<message-type>ERROR</message-type>
> 			<task-status-msg><msg-loc-info><loc-token/><loc-message>Could not  
> deploy
> xbean service unit</loc-message></msg-loc-info></task-status-msg>
> 			<exception-info>
> 				<nesting-level>1</nesting-level>
> 				<msg-loc-info>
> 					<loc-token />
> 					<loc-message>Error creating bean with name
> 'org.apache.cxf.resource.ResourceManager' defined in class path  
> resource
> [META-INF/cxf/cxf.xml]: Initialization of bean failed; nested  
> exception is
> org.springframework.beans.ConversionNotSupportedException: Failed to  
> convert
> property value of type 'java.util.ArrayList' to required type
> 'java.util.List' for property 'resolvers'; nested exception is
> java.lang.IllegalStateException: Cannot convert value of type
> [org.apache.cxf.bus.spring.BusApplicationContextResourceResolver] to
> required type [org.apache.cxf.resource.ResourceResolver] for property
> 'resolvers[2]': no matching editors or conversion strategy
> found</loc-message>
> 					<stack-trace></stack-trace>
> 				</msg-loc-info>
> 			</exception-info>
> 		</task-result-details>
> 	</component-task-result-details>
> </component-task-result>
>
> Regards,
>
> Stéphane
>
> --
> View this message in context: http://servicemix.396122.n5.nabble.com/Call-an-external-Web-Service-in-apache-servicemix-4-3-0-fuse-00-00-tp5038418p5048618.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.

---------------------------------------------
Freeman Fang

FuseSource
Email:ffang@fusesource.com
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com










Re: Call an external Web Service in apache-servicemix-4.3.0-fuse-00-00

Posted by Stephane <st...@horoquartz.fr>.
After add a camel cxf:cxfEndpoint, I have this exception when serviceMix
start :

javax.jbi.management.DeploymentException: <component-task-result
xmlns="http://java.sun.com/xml/ns/jbi/management-message">
	<component-name>servicemix-camel</component-name>
	<component-task-result-details>
		<task-result-details>
			<task-id>deploy</task-id>
			<task-result>FAILED</task-result>
			<message-type>ERROR</message-type>
			<task-status-msg><msg-loc-info><loc-token/><loc-message>Could not deploy
xbean service unit</loc-message></msg-loc-info></task-status-msg>
			<exception-info>
				<nesting-level>1</nesting-level>
				<msg-loc-info>
					<loc-token />
					<loc-message>Error creating bean with name
'org.apache.cxf.resource.ResourceManager' defined in class path resource
[META-INF/cxf/cxf.xml]: Initialization of bean failed; nested exception is
org.springframework.beans.ConversionNotSupportedException: Failed to convert
property value of type 'java.util.ArrayList' to required type
'java.util.List' for property 'resolvers'; nested exception is
java.lang.IllegalStateException: Cannot convert value of type
[org.apache.cxf.bus.spring.BusApplicationContextResourceResolver] to
required type [org.apache.cxf.resource.ResourceResolver] for property
'resolvers[2]': no matching editors or conversion strategy
found</loc-message>
					<stack-trace></stack-trace>
				</msg-loc-info>
			</exception-info>
		</task-result-details>
	</component-task-result-details>
</component-task-result>

Regards,

Stéphane

--
View this message in context: http://servicemix.396122.n5.nabble.com/Call-an-external-Web-Service-in-apache-servicemix-4-3-0-fuse-00-00-tp5038418p5048618.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: Call an external Web Service in apache-servicemix-4.3.0-fuse-00-00

Posted by Gert Vanthienen <ge...@gmail.com>.
L.S.,

Additional camel components can be installed as optional features.  In your
case, "features:install camel-cxf" and "features:install camel-http" will
allow you to install the extra components you need.

Regards,

Gert Vanthienen
------------------------
FuseSource
Web: http://fusesource.com
Blog: http://gertvanthienen.blogspot.com/


On Mon, Dec 5, 2011 at 10:32 AM, Stephane <st...@horoquartz.fr>wrote:

> Hi
>
>  You suggest to not use the HTTP Consumer Endpoint but use the Camel HTTP
> Endpoint ?
>
> But, when I use the Camel CXF Endpoint, I always have the error " No
> component found with scheme: cxf "
>
> Thank you for your help
>
> Regards
>
> Stéphane
>
> --
> View this message in context:
> http://servicemix.396122.n5.nabble.com/Call-an-external-Web-Service-in-apache-servicemix-4-3-0-fuse-00-00-tp5038418p5048327.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>

Re: Call an external Web Service in apache-servicemix-4.3.0-fuse-00-00

Posted by Stephane <st...@horoquartz.fr>.
Hi

  You suggest to not use the HTTP Consumer Endpoint but use the Camel HTTP
Endpoint ?

But, when I use the Camel CXF Endpoint, I always have the error " No
component found with scheme: cxf "

Thank you for your help

Regards

Stéphane

--
View this message in context: http://servicemix.396122.n5.nabble.com/Call-an-external-Web-Service-in-apache-servicemix-4-3-0-fuse-00-00-tp5038418p5048327.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: Call an external Web Service in apache-servicemix-4.3.0-fuse-00-00

Posted by Ravi <rc...@rgis.com>.
Gert,

The links posted does not work. Can you please redirect me to the updated
links if you have.

Thanks for the help.

Regards,
Ravi



--
View this message in context: http://servicemix.396122.n5.nabble.com/Call-an-external-Web-Service-in-apache-servicemix-4-3-0-fuse-00-00-tp5038418p5715466.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: Call an external Web Service in apache-servicemix-4.3.0-fuse-00-00

Posted by Gert Vanthienen <ge...@gmail.com>.
L.S.,


If you're new to ServiceMix, I would recommend you not to start with the
JBI approach (xbean.xml, http:endpoint, ...) but to deploy Camel routes
directly onto the container.  The quickstart guide at
http://servicemix.apache.org/docs/4.3.0-SNAPSHOT/quickstart/index.htmlshould
give you an idea about how that would work.

For your particular use case, you could use the
http://camel.apache.org/cxf.html or the http://camel.apache.org/http.htmland
http://camel.apache.org/jetty.html components to receive HTTP requests and
afterwards call out to the external web service.  You can find some more
background information about using Camel in ServiceMix and how-to install
the addtional components you need in
http://servicemix.apache.org/docs/4.3.0-SNAPSHOT/users-guide/camel/index.html
.

(These two documentation links are part of our new work-in-progress set of
user guides, so we would also welcome any feedback to make these things as
clear as possible for new users)


Regards,

Gert Vanthienen
------------------------
FuseSource
Web: http://fusesource.com
Blog: http://gertvanthienen.blogspot.com/


On Thu, Dec 1, 2011 at 12:48 PM, Stephane <st...@horoquartz.fr>wrote:

> Hello,
>
> I'm a newbie in ServiceMix and I'm trying to call an external Web Service
> from ServiceMix. I read a lot of post and I can't configure my xbean.xml
> and
> my camel-context.xml for call the external web service.
>
> So, my entry point is a HTTP Consumer. From this point, I want to call an
> external Web Service.
>
> I have configured a cxfbc like this :
>
> <beans  xmlns:cxfbc="http://servicemix.apache.org/cxfbc/1.0"
>                xmlns:dataExchange="
> http://webServices.web.squirel.horoquartz.amano.com/">
>
>        <import resource="classpath:META-INF/cxf/cxf.xml" />
>        <import resource="classpath:META-INF/cxf/cxf-extension-http.xml" />
>        <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
>        <import
> resource="classpath:META-INF/cxf/cxf-extension-http-binding.xml" />
>        <import
> resource="classpath:META-INF/cxf/cxf-extension-http-jetty.xml" />
>
>        <cxfbc:provider
> wsdl="http://localhost:8080/EasyID/services/HQCloudWebService?wsdl"
>                service="dataExchange:HQCloudWebServiceService"
>                endpoint="applicationConsCxf">
>        </cxfbc:provider>
> </beans>
>
> When my HTTP Consumer has my cxfbc for target, I have the error : Premature
> end of file
>
> After, I try to do something like this :
>
> HTTP Consumer -> Camel Router -> Cxfbc
>
> If I do that, my error is No endpoint, service or interface name specified
> for routing
> My route is
>
> <route>
> <convertBodyTo type="java.lang.String"/>
> <from
> uri="jbi:endpoint:http://servicemix.apache.org/router/DataExchange/call4
> "/>
> <to
> uri="jbi:service:
> http://webServices.web.squirel.horoquartz.amano.com/HQCloudWebServiceService
> "/>
> </route>
>
> After, I try to use cxf endpoint from Camel with a route like this :
>
> <route>
> <convertBodyTo type="java.lang.String"/>
> <from
> uri="jbi:endpoint:http://servicemix.apache.org/router/DataExchange/call3
> "/>
> <to uri="cxf:bean:customerService"/>
> </route>
>
> But I get the error No component found with scheme: cxf
> If i had these imports, I have the same error
>
> <import resource="classpath:META-INF/cxf/cxf.xml" />
> <import resource="classpath:META-INF/cxf/cxf-extension-http.xml" />
> <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
> <import resource="classpath:META-INF/cxf/cxf-extension-http-jetty.xml" />
>
> Also, I try to make a Camel bean which call my external Web Service, but I
> have the error :
>
> No conduit initiator was found for the namespace
> http://schemas.xmlsoap.org/soap/http
>
> So, what is my problem, because I don't understand how can I call a
> external
> Web Service and what is the good solution.
>
> Thanks for your help
>
> Stephane
>
> --
> View this message in context:
> http://servicemix.396122.n5.nabble.com/Call-an-external-Web-Service-in-apache-servicemix-4-3-0-fuse-00-00-tp5038418p5038418.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>