Greetings,
I am trying to use Axis with JMS as a transport, and have managed to get it
all working. But unfortunately I had to hack one thing which I suspect has a
cleaner solution.
I generate XML Bean classes for an existing WSDL in the normal way using
WSDL2Java. No problem there. But when I try to use the generated code from a
client I run into problems.
As far as I can tell the SoapBindingStub does not provide any means to get
at the TypeMappings, etc. unless one goes through the actual, public Service
call.(i.e. MyResponse xyz( MyRequest req ); or whatever). Within the
SoapBindingStub, createCall() is private, and all of the
_call.setOperation(), etc stuff happens only from within the actual Service
call. But with JMS we do not make an explicit Service call -- instead we
create the call, setup it's transport, etc, and then use call.invoke()...
To make this work I had to hack XYZSoapBindingStub to provide a new public
method named buildCall() which looks like this (I've omitted some lines for
brevity)::
public Call buildCall() throws RemoteException {
Call _call = createCall();
_call.setOperation( operations[0] );
_call.setUseSOAPAction( true );
....
return _call;
}
And in the Client I have::
Service service = new Service( provider );
XYZSoapBindingStub stub = new XYZSoapBindingStub( service );
stub.setPortName(...);
Call call = stub.buildCall()
call.setOperationName(...);
call.setTransport( new JMSTransport(...) );
....
response = call.invoke( ... );
Is there a better way to do this??
Surely hacking the generated SoapBindingImpl is not the answer.
Any help would be greatly appreciated.
Thanks,
-- Chris Berry