Excuse me , I don't have to write wsdd or any other xml document to deploy my web service , because myeclipse or other IDE tools do these for me. I wanna know about can I modify the paramters in the code so that I can get a simple object that web services return to me.
Thanks in advance.
Joined: Apr 17, 2006
If you already have a WSDL mentioning Person type as return type of web method then all you should be doing is : QName QNAME_TYPE_PERSON = new QName("<Person namespace>", "PersonType"); call.setReturnType(QNAME_TYPE_PERSON);
example: <person namespace> as defined by your service wsdl could be http://examples.org/SayHello and PersonType could be a complex type in the wsdl. Complete WSDL as i see your problem is at the end of this reply.
and you cast the result to Person type: Person person = (Person)call.invoke(params);
You will need to have the Person java bean class defined at client.
I too am learning webservices for now.. so this is no expert comment. Please treat this reply kindly and tell me if i am mistaken in understanding your question.
Use WSDL-to-Java tools to generate support classes, even if using the dynamic proxy or DII approach.
For example, just to compile the client code, the developer must understand the WSDL for a service and generate by hand Java classes that match the parameter and return types defined in the WSDL document or, in the case of a dynamic proxy, the client-side representation of the service endpoint interface. These classes must be set up properly so that the JAX-RPC runtime can match SOAP message types to the corresponding Java objects.
Above comments are excerpted from chapter 5 of Blueprints Webservices book.
So you can either hand write the Person class or better yet have the WSDL2Java generate that for your DII client.