The idea of using a WSDL 2 won't work for consuming external services because this is not implemented yet. I would go back to a standard provider with a custom marshaler: <http:provider marshaler="#marshaler" ... /> <bean id="marshaler" class="..."> </bean> That way, you should be able to control how the message exchange coming from the jms BC will be converted into an HTTP request.
On Tue, Mar 11, 2008 at 8:56 PM, Tom Purcell <[EMAIL PROTECTED]> wrote: > > Okay > Sorry. I got distracted for a few days but now I'm back. I've been trying to > get this to work today but I'm running into difficulty. This is what I'm > trying to do: > > JMS test client > servicemix-jms > servicemix-http > externally hosted > RESTful service > > The response from the RESTful service should be returned to the JMS test > client. > > Here's my sevicemix-jms xbean.xml: > <?xml version="1.0" encoding="UTF-8"?> > <beans xmlns:jms="http://servicemix.apache.org/jms/1.0" > xmlns:test="http://test" > xmlns:amq="http://activemq.org/config/1.0"> > > <jms:endpoint service="test:MyJmsQueueToRestTest" > endpoint="jmsToRestQueue" > targetService="test:PersonService" > targetEndpoint="Person" > role="consumer" > destinationStyle="queue" > jmsProviderDestinationName="myJmsQueueToRestTest" > defaultMep="http://www.w3.org/2004/08/wsdl/in-out" > connectionFactory="#connectionFactory"/> > <amq:connectionFactory id="connectionFactory" > brokerURL="tcp://localhost:61616" /> > </beans> > > Here's my sevicemix-http xbean.xml: > <?xml version="1.0" encoding="UTF-8"?> > <beans xmlns:http="http://servicemix.apache.org/http/1.0" > xmlns:person="http://example.org/Person"> > > <http:soap-consumer service="person:PersonService" > endpoint="person:Person" > defaultMep="http://www.w3.org/2004/08/wsdl/in-out" > wsdl="classpath:person.wsdl2"/> > </beans> > > Note for the time being I am using the person.wsdl2 wsdl referenced in the > earlier response. This is not what I ultimately want but right now I just > want to get the config straight deploy. > > What I'm getting on deploy is the following: > <exception-info> > <nesting-level>1</nesting-level> > <msg-loc-info> > <loc-token/> > > <loc-message>org/apache/ws/commons/schema/XmlSchemaException</loc-message> > <stack-trace><![CDATA[java.lang.NoClassDefFoundError: > org/apache/ws/commons/schema/XmlSchemaException > at org.apache.woden.internal.DOMWSDLFactory.newWSDLReader(Unknown > Source) > at > > org.apache.servicemix.http.endpoints.HttpSoapConsumerEndpoint.validateWsdl2(HttpSoapConsumerEndpoint.java:138) > at > > org.apache.servicemix.http.endpoints.HttpSoapConsumerEndpoint.validate(HttpSoapConsumerEndpoint.java:117) > at > > org.apache.servicemix.common.AbstractDeployer.validate(AbstractDeployer.java:58) > at > > org.apache.servicemix.common.xbean.BaseXBeanDeployer.validate(BaseXBeanDeployer.java:55) > at > > org.apache.servicemix.common.xbean.AbstractXBeanDeployer.deploy(AbstractXBeanDeployer.java:96) > at > > org.apache.servicemix.common.BaseServiceUnitManager.doDeploy(BaseServiceUnitManager.java:88) > at > > org.apache.servicemix.common.BaseServiceUnitManager.deploy(BaseServiceUnitManager.java:69) > at > > org.apache.servicemix.jbi.framework.DeploymentService.deployServiceAssembly(DeploymentService.java:508) > at > > org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServiceAssembly(AutoDeploymentService.java:350) > at > > org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchive(AutoDeploymentService.java:253) > at > > org.apache.servicemix.jbi.framework.AutoDeploymentService.monitorDirectory(AutoDeploymentService.java:647) > at > > org.apache.servicemix.jbi.framework.AutoDeploymentService.access$800(AutoDeploymentService.java:60) > at > > org.apache.servicemix.jbi.framework.AutoDeploymentService$1.run(AutoDeploymentService.java:611) > at java.util.TimerThread.mainLoop(Timer.java:512) > at java.util.TimerThread.run(Timer.java:462) > ]]></stack-trace> > </msg-loc-info> > </exception-info> > > I'm sure I'm doing something wrong but I don't have a clue what. > Specifically I'm not certain about the linkage between my JMS BC and the > HTTP BC and the WSDL. And as to the NoClassDefFoundError, I've run quite a > lot through my install and have not run into any such problems in the past. > I'm using the binary install of 3.2.1 with the Sun jdk 1.5.0_14-b03 on a > Suse 10.2 box. I built the 3.3 snapshot from source and got the same error. > > Any help would be appreciated. > > Thanks > Tom > > > > > > gnodet wrote: > > > > Hey Tom! > > There is currently no clean support for RESTful services, but there > > is an experimental > > support for the WSDL2 HTTP Binding in servicemix-http. It should be > > available by > > deploying an endpoint like: > > <http:soap-consumer wsdl="service.wsdl2" /> > > with the wsdl being a WSDL2 with an HTTP binding. > > Here is an example of such a wsdl: > > > > > http://svn.apache.org/repos/asf/servicemix/smx3/trunk/common/servicemix-soap2/src/test/resources/org/apache/servicemix/soap/Person.wsdl2 > > > > The http BC will produce an xml document compliant with the WSDL from > > the HTTP request. > > > > On Thu, Mar 6, 2008 at 4:06 PM, Tom Purcell > > <[EMAIL PROTECTED]> wrote > >> > >> Hello > >> > >> I have a messages that can come in over any one of several protocols. > >> When I > >> get the message I need to call a RESTful service hosted on a Tomcat > >> server. > >> I essentially have my simplest case working using the servicemix-http > >> component. Its a static URI with no variable fields in it. My problem is > >> I > >> cannot figure out how to handle variables. > >> > >> For instance, the RESTful service has the following URI: > >> http://somehost:8080/foo/1234 > >> > >> The service will return the "foo" that has the id of "1234". > >> > >> The xbean configuration of servicemix-http allows me to code a static > >> URI > >> but how do I call a RESTful service the URI for which contains dynamic > >> elements? > >> > >> Thanks > >> Tom > >> > >> -- > >> View this message in context: > >> > http://www.nabble.com/Call-a-RESTful-service-from-ServiceMix-tp15873186s12049p15873186.html > >> Sent from the ServiceMix - User mailing list archive at Nabble.com. > >> > >> > > > > > > > > -- > > Cheers, > > Guillaume Nodet > > ------------------------ > > Blog: http://gnodet.blogspot.com/ > > > > > > -- > View this message in context: > http://www.nabble.com/Call-a-RESTful-service-from-ServiceMix-tp15873186s12049p15988439.html > > > Sent from the ServiceMix - User mailing list archive at Nabble.com. > > -- Cheers, Guillaume Nodet ------------------------ Blog: http://gnodet.blogspot.com/
