I needs to generate Java client for Webservice. I have two choices to do that
one is use apache cxf DynamicClientFactory class and other is use Dispatch
API .

>From CXF documentation i understood that DynamicClientFactory class will
generate the Webservice SEI , Data classes in runtime(Using wsdl2Java tool).
If i wants to call any webservice methods i needs to load the appropriate
data class name and i needs to set the parameter using reflection like
follows.

JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();
Client client = dcf.createClient("people.wsdl", classLoader);

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);

In the above code the Person class is generated in the runtime by CXF and
reflection is used to set the property values . My question here is if i
wants to set 20 parameter values, then i needs to make 20 reflection call to
do that.Is this a efficient way to do that? or any alternative is there.

or better to use Dispatch API . Please help me. Thanks in advance.



--
View this message in context: 
http://cxf.547215.n5.nabble.com/Question-about-CXF-DynamicClientFactory-tp5713112.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to