package com.JBWS2565.client;

import javax.xml.namespace.QName;
import javax.xml.rpc.Call;
import javax.xml.rpc.Service;
import javax.xml.rpc.ServiceFactory;

public final class MyWebServiceBeanClient {

    public static void main(final String[] args) throws Exception {
        final ServiceFactory factory = ServiceFactory.newInstance();
        final Service service = factory.createService(new QName("http://my.services.web", "MyWebServiceName"));
        final Call call = service.createCall(new QName("http://my.services.web", "MyWebServicePort"));
        call.setTargetEndpointAddress("http://127.0.0.1:8080/MyEar/MyWebServiceBean?wsdl");
        call.setOperationName(new QName("http://my.services.web", "doStuff"));
        final QName QNAME_TYPE_STRING = new QName("http://www.w3.org/2001/XMLSchema", "string");
        call.setReturnType(QNAME_TYPE_STRING);
        final String[] serviceArgs = {};
        final String result = (String) call.invoke(serviceArgs);
        System.out.println(result);
    }
}
