You can not communicate that way with a remote JBI container.
You need to either:
  * use a RemoteServiceMixClient, which needs a JmsFlow to be configured on
the remote container
  * use another technology like JAX-WS to access your web service using http

On Jan 23, 2008 12:05 AM, nvijayak <[EMAIL PROTECTED]> wrote:

>
> Hi,
>
> I use the following code to create a client that invokes a service
>
>        JBIContainer container = new JBIContainer();
>        container.setUseMBeanServer(false);
>        container.setRmiPort(2999);
>        container.setCreateMBeanServer(false);
>        container.setEmbedded(true);
>        container.init();
>        container.start();
>        ServiceMixClient client = new DefaultServiceMixClient(container);
>        Destination destination =
> client.createDestination("service:http://localhost:8192/PersonService/";);
>        InOut me = destination.createInOutExchange();
>
>        me.getInMessage().setContent(new StringSource(
>                                "<jbi:message
> xmlns:jbi=\"http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper\<http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper%5C>
> ""
>                             +  "
> xmlns:msg=\"http://servicemix.apache.org/samples/wsdl-first/types\<http://servicemix.apache.org/samples/wsdl-first/types%5C>"
> "
>                             +  "             name=\"Hello\" "
>                             +  "             type=\"msg:HelloRequest\" "
>                             +  "             version=\"1.0\">"
>                             +  "  <jbi:part>"
>                             +  "
> <msg:GetPerson><msg:personId>id</msg:personId></msg:GetPerson>"
>                             +  "  </jbi:part>"
>                             +  "</jbi:message>"));
>        client.sendSync(me);
>
>        System.err.println(new
> SourceTransformer().contentToString(me.getOutMessage()));
>
> I get the following error when I run it:
>
> Exception in thread "main" javax.jbi.messaging.MessagingException: Could
> not
> find route for exchange: InOut[
>  id: ID:128.107.102.246-117a3b0ca5f-2:0
>  status: Active
>  role: provider
>  service: {http://localhost:8192/PersonService}
>  in: <?xml version="1.0" encoding="UTF-8"?><jbi:message
> xmlns:jbi="http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper";
> xmlns:msg="http://servicemix.apache.org/samples/wsdl-first/types";
> name="Hello" type="msg:HelloRequest" version="1.0">  <jbi:part>
> <msg:GetPerson><msg:personId>id</msg:personId></msg:GetPerson>
> </jbi:part></jbi:message>
> ] for service: {http://localhost:8192/PersonService} and interface: null
>        at
> org.apache.servicemix.jbi.nmr.DefaultBroker.sendExchangePacket(
> DefaultBroker.java:297)
>        at
> org.apache.servicemix.jbi.container.JBIContainer.sendExchange(
> JBIContainer.java:830)
>        at
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.doSend(
> DeliveryChannelImpl.java:395)
>        at
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(
> DeliveryChannelImpl.java:470)
>        at
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(
> DeliveryChannelImpl.java:442)
>        at
> org.apache.servicemix.client.DefaultServiceMixClient.sendSync(
> DefaultServiceMixClient.java:155)
>        at
> org.apache.servicemix.examples.CRSWSEndpointTest.main(
> CRSWSEndpointTest.java:92)
>
>
> Thanks,
> Nithya
> --
> View this message in context:
> http://www.nabble.com/Could-not-find-route-for-exchange%3A-InOut-tp15030924s12049p15030924.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>


-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/

Reply via email to