Generating JAX-WS client stubs for JAX-RPC web service?
20,411
- The tool
wsimport
works on aWSDL
file which is an XML document describing the web service. - The tool
wsimport
does not care to the style of the service (RPC/DOCUMENT) as described in the WSDL. - If the WSDL has RPC-style, it will generate the client stubs for consuming RPC-style web services and similarly for document-style.
-
JAX-WS
(which provideswsimport
) provides (or rather capable of generating ) both the style (RPC/Document) of web services and both work equally well with respective types of service end points. -
Here is an example of using
wsimport
for generating JAX-RPC client.
Hope this helps.
Comments
-
Arci about 4 years
Will I be able to connect to a JAX-RPC web service using a JAX-WS (wsimport) generated client stub? What are the effects of consuming a JAX-RPC web service using a JAX-WS client? Are there any advantages and disadvantages?
-
Arci over 11 yearsHi! Thanks for your reply! Does it mean that it doesn't matter if I'm using a wsimport generated client stubs or a wscompile generated client stubs because, in the end, I'll still be able to connect using either of the 2? My dilemna is something like this: I have a set of WSDL files. Since I don't know how to the generate client stubs yet when I received the WSDL files, I ask someone to generate the client stubs for me. The one who generated the client stubs uses IBM's RAD. Some of the files were generated using JAX-RPC while some were generated using JAX-WS.
-
Arci over 11 yearsNow here's the part where I'm confused: If he can generate all of the WSDL files using JAX-WS, then why did he generate the others using JAX-RPC? What is the relevance of generating using JAX-RPC? I know that JAX-WS is newer so why did he chose to generate the others using JAX-RPC? Can you please enlighten me on this one?
-
Santosh over 11 yearsWell,
wsimport
is the latest thing for generating web services artifacts and is better where aswscompile
is earlier way of doing the same thing. Check this link. Ideally,as you said, it does not matter whether you usewsimport
orwscompile
. But, in your particular case, why the other person usedJAX-RPC
and notJAX-WS
? Honestly I cannot figure this out. He himself is better person to answer this query. -
Santosh over 11 yearsNot sure but may be a case wherein a WSDL is too complex to be handled by normal
wsimport
and hence he is compelled to usewscompile
. But this is a remote possibility and I would be curious to know about that case. -
Arci over 11 yearsThanks! Yup, I'm also not sure why he opted to use JAX-RPC on others. In fact, I was also able to generate JAX-WS clients from the WSDL files wherein he generated the JAX-RPC clients. So there shouldn't be a problem with the WSDL file. But I won't be able to test the generated clients since I don't have access to the actual web service. :| Maybe I should ask it directly to him why he did it. Thanks for the clarification!