Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
java
java
URLClassLoader classLoader = ...;
DynamicClientFactory dcf = DynamicClientFactory.newInstance();
Client client = dcf.createClient("people.wsdl", classLoader);

//The context class loader has been reset by the dynamic client factory's create client code
Object person = Thread.currentThread().getContextClassLoader().loadClass("com.acme.Person").newInstance();

Method m = person.getClass().getMethod("setName", String.class);
m.invoke(person, "Joe Schmoe");

client.invoke("addPerson", person);

NOTE: Use of the Dynamic compiler requires a full JDK to be available. It generates java code and calls off to "javac" to compile the code. Thus, the JDK needs to be available and javac on the PATH.

COMING SOON: Groovy Web Services support for dynamic clients so you don't need to use reflection!