Hi Vincent,

I guess what you want is to do a 2 way communication with JMS where the
response from the axis service will be stored in the reply jms queue? right?
If so please have a look at the sample #264 [1];

Thanks,
Ruwan

[1] - http://synapse.apache.org/Synapse_Samples.html#Sample264

On Tue, Aug 9, 2011 at 2:29 PM, naoh V <naoh...@gmail.com> wrote:

> Hi
>
>
>
> I built my webservice on axis2 server.
>
> -------------------------------------
>
> TestInterface.class
>
> public class TestInterface {
>
>
>
> public String getInfo(String str) {
>
> return "webservice:" + str;
>
> }
>
> }
>
> ------------------------------------------
>
> --------------------------------------------------------------------------
>
> And i modified the sample_250.xml and sample_251.xml.
>
>
>
> 1)http/s to JMS
>
> <definitions xmlns="http://ws.apache.org/ns/synapse";
>
>              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>
>              xsi:schemaLocation="http://ws.apache.org/ns/synapse
> http://synapse.apache.org/ns/2010/04/configuration/synapse_config.xsd";>
>
>
>
>     <proxy name="Proxy1" transports="http">
>
>         <target>
>
>             <endpoint>
>
>                 <address
>
>
> uri="jms:/Proxy2?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&amp;java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;java.naming.provider.url=tcp://localhost:61616&amp;transport.jms.DestinationType=queue"/>
>
>             </endpoint>
>
>             <inSequence>
>
>                 <property action="set" name="OUT_ONLY" value="true"/>
>
>             </inSequence>
>
>             <outSequence>
>
>                 <send/>
>
>             </outSequence>
>
>         </target>
>
>         <publishWSDL uri="
> http://10.16.64.14:8088/axis2/services/TestInterface?wsdl"/>
>
>     </proxy>
>
>
>
> </definitions>
>
>
>
> 2)JMS to http/s
>
> <definitions xmlns="http://ws.apache.org/ns/synapse";
>
>              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>
>              xsi:schemaLocation="http://ws.apache.org/ns/synapse
> http://synapse.apache.org/ns/2010/04/configuration/synapse_config.xsd";>
>
>
>
>     <proxy name="Proxy2" transports="jms">
>
>         <target>
>
>             <inSequence>
>
>                 <property action="set" name="OUT_ONLY" value="true"/>
>
>             </inSequence>
>
>             <endpoint>
>
>                 <address uri="
> http://10.16.64.14:8088/axis2/services/TestInterface"/>
>
>             </endpoint>
>
>             <outSequence>
>
>                 <send/>
>
>             </outSequence>
>
>         </target>
>
>         <publishWSDL uri="
> http://10.16.64.14:8088/axis2/services/TestInterface?wsdl"/>
>
>     </proxy>
>
>
>
> </definitions>
>
>
>
> 3)My Java client:
>
> final String endPointReference = "http://10.16.64.14:8280/services/Proxy1
> ";
>
> final String targetNamespace = "http://proxy1";;
>
> Axis2Client client = new Axis2Client(endPointReference);
>
>
>
> String opName = "getInfo";
>
> Object[] opArgs = new Object[] { "hello" };
>
> Class<?>[] opReturnType = new Class[] { String[].class };
>
>
>
> Object[] response = client.invokeOp(targetNamespace, opName, opArgs,
> opReturnType);
>
> System.out.println(((String[]) response[0])[0]);
>
>
>
> 4) I sent a request by my client without response.(http/s to JMS)
>
> And the request message has been stored in the queue(it can be seen in the
> ActiveMQ).
>
>
>
> So how can i get a response/message by synapse (JMS to http/s)?
>
>
>
>
>
>
>
> Best Regards
>
> Vincent
>



-- 
Ruwan Linton
Member, Apache Software Foundation; http://www.apache.org
<http://wso2.org>

phone: +94 11 282 7532
email: ru...@blindvision.org; cell: +94 77 341 3097
blog: http://blog.ruwan.org
linkedin: http://www.linkedin.com/in/ruwanlinton
google: http://www.google.com/profiles/ruwan.linton
tweet: http://twitter.com/ruwanlinton

Reply via email to