users@jax-rpc.java.net

Re: jax-rpc; a basic request

From: Robert Lowe <rmlowe_at_RMLOWE.COM>
Date: Fri, 21 Mar 2003 14:31:41 +0800

You can use the wscompile tool to generate a stub and remote interface from the WSDL.

If you use the -keep option, the tool will generate source file as well as class files. You can then generate javadocs from the source files. The javadocs will tell you the available methods and their parameters.

- Rob


  ----- Original Message -----
  From: Atif Ahmad
  To: JAXRPC-INTEREST_at_JAVA.SUN.COM
  Sent: Friday, March 21, 2003 4:55 AM
  Subject: jax-rpc; a basic request


  Hi,

  I am new to web jax-rpc and have a basic question. It is about the input parameters of the methods that we are invoking. I.e. in most of the documents on java.sun.com, we create a web service and thus know the input requirements of the remote methods. In cases where we only have a WSDL file, we would not have information about the parameter requirements of the remote methods that have been documented in the WSDL file. For example, the sample code given in the jax-rpc tutorial (http://java.sun.com/webservices/docs/1.0/tutorial/doc/JAXRPC3.html#63872) invokes a remote method "sayHello". We had earlier defined the web service and therefore knew that it takes a string as a parameter.
   The source code for HelloClient follows:

package hello;

import javax.xml.rpc.Stub;

public class HelloClient {
    public static void main(String[] args) {
        try {
            Stub stub = createProxy();
            HelloIF hello = (HelloIF)stub;
            System.out.println(hello.sayHello("Duke!"));
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }

    private static Stub createProxy() {
        // Note: MyHello_Impl is implementation-specific.
        return (Stub)(new MyHello_Impl().getHelloIFPort());
    }
}
  How and where can we obtain this information about the parameter requirements? Is there any other way of finding out the names of the remote methods other than reading them from the WSDL file?Thanks a lot,Atif Ahmadatif.ahmad_at_binghamton.edu