Creating a client

If you know the url of a web service (possibly one of your own at, say for this example, http://localhost:8080/axis/Bing.jws), and you want to write a client to use that web service, you can have Axis generate some Java source code files for you to make your client code simpler:

java org.apache.axis.wsdl.WSDL2Java http://localhost:8080/axis/Bing.jws?wsdl

Whichever directory you run that WSDL2Java command in, inside it you'll now see localhost/axis/Bing_jws. Inside Bing_jws you'll find 4 autogenerated .java files. Don't touch them. They are:

Finally, to actually create your client, you'll need to create your own new class that makes use of the ones listed above. It'll probably look something like:

import localhost.axis.Bing_jws.*;
public class MyBingClient
      public static void main( String args[] ) throws Exception
            BingService service = new BingServiceLocator();
            Bing myBing = service.getBing();
            // call instance methods on myBing, ex., say, 

FrontPage/Axis/WritingYourClient (last edited 2009-09-20 22:47:28 by localhost)