apache.axis.client.Service axisServiceObj =
new org.apache.axis.client.Service();
org.apache.axis.client.Call axisCall =
(org.apache.axis.client.Call)axisServiceObj.
createCall();
axisCall.setOperationName("hello");
axisCall.addParameter("in0", org.apache.axis.
encoding.XMLType.XSD_STRING, javax.xml.rpc.
ParameterMode.IN );
axisCall.setReturnType(org.apache.axis.encoding.
XMLType.XSD_STRING);
org.apache.axis.client.Transport transport = new
JMSTransportForAxis();
axisCall.setTransport(transport);
axisCall.setProperty("REQUEST_QUEUE", "queue/A");
axisCall.setProperty("RESPONSE_QUEUE", "queue/B");
String res = (String) axisCall.invoke(new Object[]
{"Binil"});
System.out.println("res: " + res);
}
}
???
?°
Access Web Services Using the JMS Channel
[ 216 ]
As we can see in the code listing, we first create an Axis Call instance and
set the operation name (which is the method name of the remote web service)
and the input parameters to invoke the operation. We also need to set the
return type details so that the Call instance can unmarshall any return type
recieved from the transport channel to the suitable Java type.
Pages:
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306