You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by stb <st...@hp.com> on 2006/05/05 13:10:11 UTC

Route and transform SOAP RPCs

I'd like to connect three applications using ServixeMix and need some help,
because I'm struggling with selecting the right approach.

Application A1 sends SOAP RPC messages and these SOAP messages shall be
dynamically routed to either application A2 or A3. A2 and A3 expose slightly
different web services than A1. That means I need to transform the SOAP
request before it can be sent to A2 or A3. The SOAP response must be
transformed as well.

I thought I simply could use the ServiceMix 2.x HTTP Binding example and add
a router and XSLT transformer SE. It seems I've a problem bridging InOut and
InOnly MEP (?).

How can I use routing and transformation in a InOut MEP?

I would appreciate any advice.

--
View this message in context: http://www.nabble.com/Route-and-transform-SOAP-RPCs-t1563241.html#a4245270
Sent from the ServiceMix - User forum at Nabble.com.


Re: Route and transform SOAP RPCs

Posted by dkd <dk...@gmail.com>.
I missunderstood the "java.lang.IllegalStateException: Use an InOut MEP"
error message.

The problem was that I was using a FilePoller before the RoutingSlip and
this was causing the error because the FilePoller was passing a InOnly MEP
to the RoutingSlip.

The issue was solved by using a PipeLine (just a suggested) before the
RoutingSlip:

FilePoller ---- PipeLine ---- RoutingSlip --- T1 --- T2 ---- ... --- Tn ----
FileWriter
                     |
                  TraceComponent

Thank you

-- 
View this message in context: http://www.nabble.com/Route-and-transform-SOAP-RPCs-tf1563241.html#a5220953
Sent from the ServiceMix - User forum at Nabble.com.


Re: Route and transform SOAP RPCs

Posted by dkd <dk...@gmail.com>.
I am wondering about same thing.

I was hoping to use multiple xslt transformations within the static routing
slip. Like so:

<eip:static-routing-slip service="test:routingSlip" endpoint="endpoint">
								<eip:targets>
									<eip:exchange-target service="foo:transformer1" />
                                                                       
<eip:exchange-target service="foo:transformer2" />
                                                                       
<eip:exchange-target service="foo:transformer4" />
                                                                       
<eip:exchange-target service="foo:transformer3" />
									<eip:exchange-target service="foo:fileSender" />
								</eip:targets>
							</eip:static-routing-slip>

This is however not possible because the XsltComponent is an InOnly MEP
whereas the static routing slip requires an InOut MEP.

I don't see how to use the eip:pipeline component to bridge a InOut MEP to
InOnly MEP (while I see how the opposite would be possible).

Is there something I am missing?

Thank you,
-- 
View this message in context: http://www.nabble.com/Route-and-transform-SOAP-RPCs-tf1563241.html#a5203494
Sent from the ServiceMix - User forum at Nabble.com.


Re: Route and transform SOAP RPCs

Posted by stb <st...@hp.com>.
Thank you! Now it works.
--
View this message in context: http://www.nabble.com/Route+and+transform+SOAP+RPCs-t1563241.html#a4566344
Sent from the ServiceMix - User forum at Nabble.com.


Re: Route and transform SOAP RPCs

Posted by markpittsnh <ma...@yahoo.com>.
I found it under servicemix-core-3.0-SNAPSHOT.jar under lib folder.

Regards,
Mark
--
View this message in context: http://www.nabble.com/Route+and+transform+SOAP+RPCs-t1563241.html#a4565944
Sent from the ServiceMix - User forum at Nabble.com.


Re: Route and transform SOAP RPCs

Posted by stb <st...@hp.com>.
I've copied the jars and get an other error. I've the
servicemix-jbi-3.0-SNAPSHOT.jar in the lib directory and this jar contains
the javax/jbi/servicedesc/EndpointSupport. It seems I require
org/apache/servicemix/jbi/servicedesc/EndpointSupport (?)

Any help?

Best regards,
  Stefan


Caught: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'jbi' defined in file [C:
\lbin\servicemix-3.0-M1\play\http-binding\servicemix_eip_http_echo.xml]:
Initialization of bean failed; nested exception
 is java.lang.NoClassDefFoundError:
org/apache/servicemix/jbi/servicedesc/EndpointSupport
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'jbi' defined in file [C:\lbin\se
rvicemix-3.0-M1\play\http-binding\servicemix_eip_http_echo.xml]:
Initialization of bean failed; nested exception is java
.lang.NoClassDefFoundError:
org/apache/servicemix/jbi/servicedesc/EndpointSupport
java.lang.NoClassDefFoundError:
org/apache/servicemix/jbi/servicedesc/EndpointSupport
        at
org.apache.servicemix.common.EndpointSupport.getKey(EndpointSupport.java:25)
        at
org.apache.servicemix.common.EndpointSupport.getKey(EndpointSupport.java:33)
        at
org.apache.servicemix.common.ServiceUnit.addEndpoint(ServiceUnit.java:127)
        at
org.apache.servicemix.eip.EIPSpringComponent$LifeCycle.doInit(EIPSpringComponent.java:76)
        at
org.apache.servicemix.common.BaseLifeCycle.init(BaseLifeCycle.java:108)
--
View this message in context: http://www.nabble.com/Route+and+transform+SOAP+RPCs-t1563241.html#a4565874
Sent from the ServiceMix - User forum at Nabble.com.


Re: Route and transform SOAP RPCs

Posted by Guillaume Nodet <gn...@gmail.com>.
See
http://servicemix.goopen.org/site/unrecognized-xbean-namespace-mapping.html
I guess this is the second error

Cheers,
Guillaume Nodet.

On 5/24/06, stb <st...@hp.com> wrote:
>
>
> As you recommended, I try to use the RoutingSlip, but get this error :-(
>
>
> ------------------------------------------
> Apache ServiceMix ESB: 3.0-M1
>
> Loading Apache ServiceMix from file: servicemix_eip_http_echo.xml
> INFO - ComponentMBeanImpl.init(184) | Initializing component:
> #SubscriptionManager#
> INFO - DeploymentService.buildState(683) | Restoring service assemblies
> INFO - JBIContainer.init(508) | ServiceMix JBI Container
> (http://servicemix.org/) name: ServiceMix running version: 3.0-
> M1
> INFO - ComponentMBeanImpl.init(184) | Initializing component: httpReceiver
> INFO - JCLLoggerAdapter.info(216) | Logging to
> org.slf4j.impl.JCLLoggerAdapter@633d51 via org.mortbay.log.Slf4jLog
> Caught: org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'jbi' defined in file [C:
> \lbin\servicemix-3.0-M1\play\http-binding\servicemix_eip_http_echo.xml]:
> Initialization of bean failed; nested exception
> is java.lang.IllegalArgumentException: Component name: servicemix-eip is
> bound to an object which is not a JBI componen
> t, it is of type: javax.xml.namespace.QName
> org.springframework.beans.factory.BeanCreationException: Error creating
> bean
> with name 'jbi' defined in file [C:\lbin\se
> rvicemix-3.0-M1\play\http-binding\servicemix_eip_http_echo.xml]:
> Initialization of bean failed; nested exception is java
> .lang.IllegalArgumentException: Component name: servicemix-eip is bound to
> an object which is not a JBI component, it is
> of type: javax.xml.namespace.QName
> java.lang.IllegalArgumentException: Component name: servicemix-eip is
> bound
> to an object which is not a JBI component, i
> t is of type: javax.xml.namespace.QName
>         at
> org.apache.servicemix.jbi.container.JBIContainer.activateComponent(
> JBIContainer.java:885)
>         at
> org.apache.servicemix.jbi.container.SpringJBIContainer.afterPropertiesSet(
> SpringJBIContainer.java:67)
>         at
>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods
> (AbstractAutowi
> reCapableBeanFactory.java:1059)
>         at
>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean
> (AbstractAutowireCapab
> leBeanFactory.java:363)
>         at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(
> AbstractBeanFactory.java:226)
>         at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(
> AbstractBeanFactory.java:147)
>         at
>
> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons
> (DefaultListable
> BeanFactory.java:275)
>         at
> org.springframework.context.support.AbstractApplicationContext.refresh(
> AbstractApplicationContext.java:320)
>         at
> org.apache.xbean.spring.context.FileSystemXmlApplicationContext.<init>(
> FileSystemXmlApplicationContext.java:1
> 49)
>         at
> org.apache.xbean.spring.context.FileSystemXmlApplicationContext.<init>(
> FileSystemXmlApplicationContext.java:4
> 8)
>         at org.apache.servicemix.Main.main(Main.java:74)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java
> :39)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at
> org.codehaus.classworlds.Launcher.launchStandard(Launcher.java:410)
>         at org.codehaus.classworlds.Launcher.launch(Launcher.java:344)
>         at org.codehaus.classworlds.Launcher.main(Launcher.java:461)
> ---------------------
>
> I've following servicemix.xml:
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns:sm="http://servicemix.apache.org/config/1.0"
> xmlns:eip="http://servicemix.apache.org/eip/1.0" xmlns:test="http://test">
>         <sm:container id="jbi" rootDir="./wdir" useMBeanServer="true"
> createMBeanServer="true" installationDirPath="./install"
> deploymentDirPath="./deploy" dumpStats="true" statsInterval="10"
> flowName="seda">
>                 <sm:activationSpecs>
>                         <sm:activationSpec id="httpReceiver"
> service="test:httpBinding"
> endpoint="httpReceiver" destinationService="test:routingSlip">
>                                 <sm:component>
>                                         <bean class="
> org.apache.servicemix.components.http.HttpConnector">
>                                                 <property name="host"
> value="localhost"/>
>                                                 <property name="port"
> value="8912"/>
>                                         </bean>
>                                 </sm:component>
>                         </sm:activationSpec>
>                         <sm:activationSpec id="servicemix-eip">>
>                                 <sm:component>
>                                         <eip:component>
>                                                 <eip:endpoints>
>                                                         <eip:static-routing-slip
> service="test:routingSlip"
> endpoint="endpoint">
>
>                                                                 <eip:targets>
>                                                                         <eip:exchange-target
> service="test:echo"/>
>                                                                         <eip:exchange-target
> service="test:echo"/>
>
>                                                                 </eip:targets>
>
>                                                         </eip:static-routing-slip>
>                                                 </eip:endpoints>
>                                         </eip:component>
>                                 </sm:component>
>                         </sm:activationSpec>
>                         <sm:activationSpec id="echo" service="test:echo"
> endpoint="endpoint">
>                                 <sm:component>
>                                         <bean class="
> org.apache.servicemix.components.util.EchoComponent"/>
>                                 </sm:component>
>                         </sm:activationSpec>
>                 </sm:activationSpecs>
>         </sm:container>
> </beans>
>
> What I am doing wrong?
> --
> View this message in context:
> http://www.nabble.com/Route+and+transform+SOAP+RPCs-t1563241.html#a4547847
> Sent from the ServiceMix - User forum at Nabble.com.
>
>


-- 
Cheers,
Guillaume Nodet

Re: Route and transform SOAP RPCs

Posted by stb <st...@hp.com>.
As you recommended, I try to use the RoutingSlip, but get this error :-(


------------------------------------------
Apache ServiceMix ESB: 3.0-M1

Loading Apache ServiceMix from file: servicemix_eip_http_echo.xml
INFO - ComponentMBeanImpl.init(184) | Initializing component:
#SubscriptionManager#
INFO - DeploymentService.buildState(683) | Restoring service assemblies
INFO - JBIContainer.init(508) | ServiceMix JBI Container
(http://servicemix.org/) name: ServiceMix running version: 3.0-
M1
INFO - ComponentMBeanImpl.init(184) | Initializing component: httpReceiver
INFO - JCLLoggerAdapter.info(216) | Logging to
org.slf4j.impl.JCLLoggerAdapter@633d51 via org.mortbay.log.Slf4jLog
Caught: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'jbi' defined in file [C:
\lbin\servicemix-3.0-M1\play\http-binding\servicemix_eip_http_echo.xml]:
Initialization of bean failed; nested exception
 is java.lang.IllegalArgumentException: Component name: servicemix-eip is
bound to an object which is not a JBI componen
t, it is of type: javax.xml.namespace.QName
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'jbi' defined in file [C:\lbin\se
rvicemix-3.0-M1\play\http-binding\servicemix_eip_http_echo.xml]:
Initialization of bean failed; nested exception is java
.lang.IllegalArgumentException: Component name: servicemix-eip is bound to
an object which is not a JBI component, it is
 of type: javax.xml.namespace.QName
java.lang.IllegalArgumentException: Component name: servicemix-eip is bound
to an object which is not a JBI component, i
t is of type: javax.xml.namespace.QName
        at
org.apache.servicemix.jbi.container.JBIContainer.activateComponent(JBIContainer.java:885)
        at
org.apache.servicemix.jbi.container.SpringJBIContainer.afterPropertiesSet(SpringJBIContainer.java:67)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowi
reCapableBeanFactory.java:1059)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapab
leBeanFactory.java:363)
        at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)
        at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
        at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListable
BeanFactory.java:275)
        at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:320)
        at
org.apache.xbean.spring.context.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:1
49)
        at
org.apache.xbean.spring.context.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:4
8)
        at org.apache.servicemix.Main.main(Main.java:74)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at
org.codehaus.classworlds.Launcher.launchStandard(Launcher.java:410)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:344)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:461)
---------------------

I've following servicemix.xml:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:sm="http://servicemix.apache.org/config/1.0"
xmlns:eip="http://servicemix.apache.org/eip/1.0" xmlns:test="http://test">
	<sm:container id="jbi" rootDir="./wdir" useMBeanServer="true"
createMBeanServer="true" installationDirPath="./install"
deploymentDirPath="./deploy" dumpStats="true" statsInterval="10"
flowName="seda">
		<sm:activationSpecs>
			<sm:activationSpec id="httpReceiver" service="test:httpBinding"
endpoint="httpReceiver" destinationService="test:routingSlip">
				<sm:component>
					<bean class="org.apache.servicemix.components.http.HttpConnector">
						<property name="host" value="localhost"/>
						<property name="port" value="8912"/>
					</bean>
				</sm:component>
			</sm:activationSpec>
			<sm:activationSpec id="servicemix-eip">>
				<sm:component>
					<eip:component>
						<eip:endpoints>
							<eip:static-routing-slip service="test:routingSlip"
endpoint="endpoint">
								<eip:targets>
									<eip:exchange-target service="test:echo"/>
									<eip:exchange-target service="test:echo"/>
								</eip:targets>
							</eip:static-routing-slip>
						</eip:endpoints>
					</eip:component>
				</sm:component>
			</sm:activationSpec>
			<sm:activationSpec id="echo" service="test:echo" endpoint="endpoint">
				<sm:component>
					<bean class="org.apache.servicemix.components.util.EchoComponent"/>
				</sm:component>
			</sm:activationSpec>
		</sm:activationSpecs>
	</sm:container>
</beans>

What I am doing wrong?
--
View this message in context: http://www.nabble.com/Route+and+transform+SOAP+RPCs-t1563241.html#a4547847
Sent from the ServiceMix - User forum at Nabble.com.


Re: Route and transform SOAP RPCs

Posted by Guillaume Nodet <gn...@gmail.com>.
Why do you want to use an InOnly ?
You do not want to handle the response coming from the SOAP RPC call ?
If yes, just use a RoutingSlip with two targets: an xslt transformer
and the target SOAP BC ...

Cheers,
Guillaume Nodet

On 5/6/06, stb <st...@hp.com> wrote:
>
> Many thanks for the quick reply, but it seems neither the Pipeline component
> nor the RoutingSlip component can help (?). The documentation says that the
> RoutingSlip component only uses In-Out MEPs and that the Pipeline component
> is a bridge between an In-Only (or Robust-In-Only) MEP and an In-Out MEP.
>
> I think I would require something that is a bridge between an In-Out MEP and
> an In-Only MEP, because the http BC receives an synchronous SOAP RPC and I
> like to apply routing and transformation on the SOAP request.
>
> Is there any workaround or design trick for this use case?
>
> Best regards,
>   Stefan
>
> --
> View this message in context: http://www.nabble.com/Route-and-transform-SOAP-RPCs-t1563241.html#a4264079
> Sent from the ServiceMix - User forum at Nabble.com.
>
>

Re: Route and transform SOAP RPCs

Posted by stb <st...@hp.com>.
Many thanks for the quick reply, but it seems neither the Pipeline component
nor the RoutingSlip component can help (?). The documentation says that the
RoutingSlip component only uses In-Out MEPs and that the Pipeline component
is a bridge between an In-Only (or Robust-In-Only) MEP and an In-Out MEP.

I think I would require something that is a bridge between an In-Out MEP and
an In-Only MEP, because the http BC receives an synchronous SOAP RPC and I
like to apply routing and transformation on the SOAP request.

Is there any workaround or design trick for this use case?

Best regards,
  Stefan

--
View this message in context: http://www.nabble.com/Route-and-transform-SOAP-RPCs-t1563241.html#a4264079
Sent from the ServiceMix - User forum at Nabble.com.


Re: Route and transform SOAP RPCs

Posted by Guillaume Nodet <gn...@gmail.com>.
Take a look at http://incubator.apache.org/servicemix/servicemix-eip#servicemix-eip-Pipeline
and http://incubator.apache.org/servicemix/servicemix-eip#servicemix-eip-StaticRoutingSlip.

Cheers,
Guillaume Nodet

On 5/5/06, stb <st...@hp.com> wrote:
>
> I'd like to connect three applications using ServixeMix and need some help,
> because I'm struggling with selecting the right approach.
>
> Application A1 sends SOAP RPC messages and these SOAP messages shall be
> dynamically routed to either application A2 or A3. A2 and A3 expose slightly
> different web services than A1. That means I need to transform the SOAP
> request before it can be sent to A2 or A3. The SOAP response must be
> transformed as well.
>
> I thought I simply could use the ServiceMix 2.x HTTP Binding example and add
> a router and XSLT transformer SE. It seems I've a problem bridging InOut and
> InOnly MEP (?).
>
> How can I use routing and transformation in a InOut MEP?
>
> I would appreciate any advice.
>
> --
> View this message in context: http://www.nabble.com/Route-and-transform-SOAP-RPCs-t1563241.html#a4245270
> Sent from the ServiceMix - User forum at Nabble.com.
>
>