THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
Sometimes when you work with web services, you don't want to have to generate a client at build time. Its much more convenient to create a client at runtime and use it dynamically. CXF has a DynamicClientFactory class designed for just this.
...
Code Block | ||||
---|---|---|---|---|
| ||||
URLClassLoader classLoader = ...; DynamicClientFactory dcf = DynamicClientFactory.newInstance(); Client client = dcf.createClient("people.wsdl", classLoader); Object person = classLoader.loadClass("com.acme.Person").newInstance(); Method m = bookperson.getClass().getMethod("setName", String.class); m.invoke(bookperson, "Joe Schmoe"); client.invoke("addPerson", person); |
...