You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fx-dev@ws.apache.org by Benjamin Schmeling <Be...@gmx.de> on 2005/11/29 15:43:21 UTC
synchronous calls problem
Hi,
I've got a problem with my sequence below. The thread never ends if I
had chosen to use sandesha in a synchronous way. The TerminateSequence
message was sent but the program never ends automatically. If I call
this fucntion twice, first asynchronously and after that synchronously,
the program ends normally. What should I do to solve this problem? (I
have already tried to set the AcksToURL and the ReplyToURL but it did
not work either)
Thanks,
Benjamin
private static void callOnewaySequence(int sync) throws
ServiceException, MalformedURLException, RemoteException{
String endpoint =
"http://majestix:8080/axis/services/TestWebservice";
SandeshaContext ctx = new SandeshaContext();
if(org.apache.sandesha.Constants.SYNCHRONOUS == sync)
ctx = new SandeshaContext(sync);
// --------------------------- Init -------------------------//
String operationName = "testWSOneway1";
Service service1 = new Service();
Call call1;
call1 = (Call) service1.createCall();
ctx.initCall(call1, endpoint,
"urn:wsrm:"+operationName,org.apache.sandesha.Constants.ClientProperties.IN_ONLY);
call1.setTargetEndpointAddress( new java.net.URL(endpoint) );
call1.setOperationName(new QName("TestWebservice", operationName));
call1.addParameter("message",
org.apache.axis.Constants.XSD_STRING,
javax.xml.rpc.ParameterMode.IN);
//---------------------------- Service 1
------------------------------- //
call1.setOperationName(new QName("TestWebservice",
"testWSOneway1"));
Object[] paramArray1 = new Object[] {"message1 sent by
callOnewaySequence"};
call1.invoke(paramArray1);
// ---------------------------- Service 2
------------------------------- //
call1.setOperationName(new QName("TestWebservice",
"testWSOneway2"));
Object[] paramArray2 = new Object[] {"message2 sent by
callOnewaySequence"};
call1.invoke(paramArray2);
//---------------------------- Service 3
------------------------------- //
call1.setOperationName(new QName("TestWebservice",
"testWSOneway3"));
ctx.setLastMessage(call1);
Object[] paramArray3 = new Object[] {"message3 sent by
callOnewaySequence"};
call1.invoke(paramArray3);
ctx.endSequence();
}