Generating JAX-WS client stubs for JAX-RPC web service?

20,411
  1. The tool wsimport works on a WSDL file which is an XML document describing the web service.
  2. The tool wsimport does not care to the style of the service (RPC/DOCUMENT) as described in the WSDL.
  3. If the WSDL has RPC-style, it will generate the client stubs for consuming RPC-style web services and similarly for document-style.
  4. JAX-WS (which provides wsimport) 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.
  5. Here is an example of using wsimport for generating JAX-RPC client.

Hope this helps.

Share:
20,411
Arci
Author by

Arci

An Android and J2EE developer.

Updated on April 07, 2020

Comments

  • Arci
    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
    Arci over 11 years
    Hi! 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
    Arci over 11 years
    Now 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
    Santosh over 11 years
    Well, wsimport is the latest thing for generating web services artifacts and is better where as wscompile is earlier way of doing the same thing. Check this link. Ideally,as you said, it does not matter whether you use wsimport or wscompile. But, in your particular case, why the other person used JAX-RPC and not JAX-WS? Honestly I cannot figure this out. He himself is better person to answer this query.
  • Santosh
    Santosh over 11 years
    Not sure but may be a case wherein a WSDL is too complex to be handled by normal wsimport and hence he is compelled to use wscompile. But this is a remote possibility and I would be curious to know about that case.
  • Arci
    Arci over 11 years
    Thanks! 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!