public void testInvokeWithAddressing()
throws Exception
{
service.addInHandler(new AddressingInHandler());
service.addOutHandler(new AddressingOutHandler());
service.addFaultHandler(new AddressingOutHandler());
Channel serverChannel = serverTrans.createChannel("Echo");
DefaultTransportManager tm = new DefaultTransportManager();
tm.initialize();
tm.register(clientTrans);
factory = new ObjectServiceFactory(tm) {
protected OperationInfo addOperation(Service endpoint, Method method, String style)
{
OperationInfo op = super.addOperation(endpoint, method, style);
new AddressingOperationInfo(op);
return op;
}
};
factory.addSoap11Transport(XMPPTransport.BINDING_ID);
Service serviceModel = factory.create(Echo.class);
Client client = new Client(clientTrans, serviceModel, id + "/Echo");
client.addInHandler(new AddressingInHandler());
client.addOutHandler(new AddressingOutHandler());
client.addFaultHandler(new AddressingInHandler());
OperationInfo op = serviceModel.getServiceInfo().getOperation("echo");
Object[] response = client.invoke(op, new Object[] { "hello" });