FileDocCategorySizeDatePackage
HelloClient.javaAPI DocApache Axis 1.41140Sat Apr 22 18:56:52 BST 2006samples.jaxrpc.hello

HelloClient

public class HelloClient extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

        String UrlString = "http://localhost:8080/axis/services/HelloPort?wsdl";
        String nameSpaceUri = "http://hello.jaxrpc.samples/";
        String serviceName = "HelloWorld";
        String portName = "HelloPort";

        URL helloWsdlUrl = new URL(UrlString);
        ServiceFactory serviceFactory = ServiceFactory.newInstance();
        Service helloService = serviceFactory.createService(helloWsdlUrl,
                new QName(nameSpaceUri, serviceName));

        java.util.List list = helloService.getHandlerRegistry().getHandlerChain(new QName(nameSpaceUri, portName));
        list.add(new javax.xml.rpc.handler.HandlerInfo(ClientHandler.class,null,null));

        Hello myProxy = (Hello) helloService.getPort(
                new QName(nameSpaceUri, portName),
                samples.jaxrpc.hello.Hello.class);

        System.out.println(myProxy.sayHello("Buzz"));