synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vijayaratha vijayasingam <vijayara...@yahoo.co.uk>
Subject Re: Ask for some help ,thanks
Date Tue, 09 Aug 2011 16:25:40 GMT
Hi,
You have set the 'OUT_ONLY'property, which indicates that you are not expecting response from
synapse..
Simply you can remove that property or else you can add "FORCE_SC_ACCEPTED" property to get HTTP
202 Accepted response.


-Ratha.   



________________________________
From: naoh V <naohsun@gmail.com>
To: synapse-dev@ws.apache.org
Sent: Tuesday, 9 August 2011, 14:29
Subject: Ask for some help ,thanks


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
Mime
View raw message