Here's a Dispatch example (including links to more info):
http://www.jroller.com/gmazza/entry/calling_rpc_encoded_web_services
Glen
On 10.01.2011 11:04, Daniel Kulp wrote:
On Thursday 06 January 2011 10:54:09 pm algol68 wrote:
I am writing some "general purpose" code to allow me to invoke web service
without knowing much about it. Code below is example of dynamic call from
http://cxf.apache.org/docs/dynamic-clients.html:
JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();
Client client = dcf.createClient(serviceWsdlUrl);
Object[] res = client.invoke(serviceOperation, serviceParameters);
My understanding is that when client is created wsdl is read and cxf then
creates and adds types from wsdl to the classpath (on the fly). invoke
method then executes actual web service / "service operation" (with
parameters). Result is then passed back as array of objects but it is
strongly typed.
I would like to be able to do the above but with invoke not going against
actual server but rather loading response soap from local file. Please keep
in mind that I don't have classes on the classpath I want to unmarshal and
that I want to match "Object[] res" structure so this process works the
same way when I connect to the server and start using actual web service.
Any help would be appreciated ;-)
In all honesty, this type of thing is more the ball park of the JAX-WS
Dispatch clients. You would create a Service with the WSDL URL, then have
it create a Dispatch in MESSAGE mode (if the xml messages are the full SOAP
messages, PAYLOAD if just the contents of SOAP:Body), and then pass the XML
that way.