camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From borgel <borge.lo...@gmail.com>
Subject Re: Spring Remoting
Date Mon, 08 Oct 2007 08:40:46 GMT

Yes, i want to do spring remoting, so i removed the Say and ISay stuff (that
was just for testing). The url of the remote service is:
http://www.remoteserver.no/integration-service/remoting/CustomerService
My goal is to call a method on the server synchronously.

How do i specify which method to call on the service?
Am i supposed to do the routing like this:
from("bean:customerService").to("bean:customerServiceProxy")?
Sorry for the basic questions, but i am rather new to Camel, and i don't see
how to do this.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN"
"http://www.springframework.org/dtd/spring-beans-2.0.dtd" >

<beans>

	<!--  CamelContext -->
	<bean id="camel" class="org.apache.camel.spring.CamelContextFactoryBean">
		<property name="packages" value="no.example.camel"/>
	</bean>


	<!--  Creates a proxy to the endpoint. -->
	<bean id="customerServiceProxy"
class="org.apache.camel.spring.remoting.CamelProxyFactoryBean">
	  <property name="serviceUrl"
value="http://www.remoteserver.no/integration-service/remoting/CustomerService"/>
	  <property name="serviceInterface"
value="no.service.backend.CustomerService"/>
	</bean>
	
<!-- here my routes are defined -->
	<bean id="routeBuilder" class="no.example.camel.MyRouteBuilder">
	</bean>
	
	<!--  Exposes the above bean -->	
	<bean id="customerService"
class="org.apache.camel.spring.remoting.CamelServiceExporter">
	  <property name="uri" value="bean:customerService"/>
	  <property name="service">
	    <bean class="no.example.camel.Customer"/> <!-- What am i supposed to
refer to her? -->
	  </property>
	  <property name="serviceInterface"
value="no.service.backend.CustomerService"/>
	</bean>

</beans>



James.Strachan wrote:
> 
> On 05/10/2007, borgel <borge.lotre@gmail.com> wrote:
>>
>> Hi,
>>
>> We are using Hessian Spring Remoting today and I wanted to test this
>> together with Camel.
> 
> BTW we should do a Hessian component for Camel so folks could use that
> as a wire format.
> 
> 
>> I started with
>> http://activemq.apache.org/camel/spring-remoting.html the example you
>> have
>> created .
>>
>> I have created an ISay interface with the method say() and an
>> implementation
>> of this in SayService. In addition I have a Controller and a RouteBuilder
>> classes. The routebuilder just do
>> from("direct:say").to("direct:sayImpl").
>>
>> I added the routebuilder as a bean in my applicationContext.xml file.
>>
>> When i start Tomcat I receive:
>> BeanCreationException: Error creating bean with name 'sayProxy' defined
>> in
>> ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of
>> init method failed; nested exception is
>> java.lang.IllegalArgumentException:
>> java.lang.IllegalArgumentException: If endpoint is not specified, the
>> serviceUrl and camelContext must be specified.
>>
>> What am i doing wrong and where am i supposed to specify the Hessian
>> service
>> url?
> 
> Could you post your entire Spring.xml so we can see? Note that the
> endpoint "direct:sayImpl" will just invoke any consumers on that
> endpoint. To invoke a bean, such as the sayImpl you could use
> "bean:sayImpl" (or whatever the name is in your spring XML)
> 
> BTW if you just wanna do spring remoting; there are proxy factory and
> service exporter XML elements you can use...
> 
> <proxy> or <export>
> 
> http://activemq.apache.org/camel/maven/camel-spring/xsddoc/
> 
> -- 
> James
> -------
> http://macstrac.blogspot.com/
> 
> Open Source SOA
> http://open.iona.com
> 
> 

-- 
View this message in context: http://www.nabble.com/Spring-Remoting-tf4574561s22882.html#a13092702
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message