views:

630

answers:

4

I need to create dynamic invoker of webservices based on their WSDL. any idea? thanks

A: 

See JAX-RPC; what you need is Dynamic proxies or Dynamic Invocation Interface (DII) if client doesn't know the remote method name or its signature.

Here a good example of what you can do with JAX-RPC having just a WSDL as input.

As said in the comment, JAX-RPC is evolved to JAX-WS.

systempuntoout
no - JAX-RPC is outdated. JAX-WS is "fresh"
Bozho
Does it mean that anyway I should parse the wsdl to get the required information like: servicename, portTypes, operations,...?
Milan
@Bozho Ok for the freshness :); but help me to find an example with JAX-WS that uses DII.
systempuntoout
JAX-WS's DII is the Dispatch object (`javax.xml.ws.Dispatch`).
Pascal Thivent
A: 

http://cxf.apache.org/docs/dynamic-clients.html

Generates clients on the fly.

Calm Storm
yes, but anyway before I invoke the webservice I should know the operation and the message?
Milan
Ok, If you dont know what operation/message you are calling, how are you plannign to invoke a webservice? This CXF thingy generates clients on the fly in that if the wsdl grammar has changed it gets regenerated. You still need to know an operation name :)
Calm Storm
You are right :) I need to know the operation name:) But what about the messages sent and recieved? If I should make dynamic client invoker, it means that I should write wsdl parser anyway?
Milan
+1  A: 

have you read this pages ?

Dynamic Discovery and Invocation of Web services

Dynamically Invoking a Web Service

Update

C# – Dynamically Invoke Web Service At Runtime

Creating a dynamic Web service to simplify code From 2006

drorhan
Second link refers to .NET
systempuntoout
"Dynamic Discovery and Invocation of Web services", Date: 01 Aug 2001.Isnt little bit complicated, doesnt exist easier way?
Milan
Actualy I need to write the invoker in Java, Eclipse + JSF.
Milan
A: 

I think you are looking for this

Dynamic Web service invocation from WSDL

http://www.computing.dcu.ie/~mwang/DI/di.html

super