Test returning output params
// Register the service
Handler h = new ServiceHandler();
s_service = new Service();
client = (Call) s_service.createCall();
// ??? Do we need to register the handler?
SOAPService service = new SOAPService(h);
provider.deployService(serviceURN, service);
// Make sure the local transport uses the server we just configured
client.setTransport(new LocalTransport(server));
// Create the message context
MessageContext msgContext = new MessageContext(server);
// Construct the soap request
SOAPEnvelope envelope = new SOAPEnvelope();
msgContext.setRequestMessage(new Message(envelope));
client.addParameter(
new QName("", "string"),
XMLType.XSD_STRING,
javax.xml.rpc.ParameterMode.IN);
client.addParameter(
new QName("", "out1"),
XMLType.XSD_STRING,
javax.xml.rpc.ParameterMode.OUT);
client.addParameter(
new QName("", "out2"),
XMLType.XSD_FLOAT,
javax.xml.rpc.ParameterMode.OUT);
client.setReturnType(XMLType.XSD_INT);
// Invoke the Axis server
Object ret = client.invoke(serviceURN, "method",
new Object [] { "test" });
Map outParams = client.getOutputParams();
assertNotNull("No output Params returned!", outParams);
Object param = outParams.get(new QName(null, "out1"));
assertEquals("Param out1 does not equal expected value", ServiceHandler.OUTPARAM1, param);
param = outParams.get(new QName(null, "out2"));
assertEquals("Param out2 does not equal expected value", ServiceHandler.OUTPARAM2, param);
assertEquals("Return value does not equal expected value", ((Integer)ret).intValue(), ServiceHandler.RESPONSE.intValue());