[jboss-user] [JBossWS] - How to write a Client for this simple wsconsume output?

thoste do-not-reply at jboss.com
Sat Apr 26 11:20:38 EDT 2008


I have difficulties to write simple Client which access an existing Web Service.
The output of wsconsume on the WSDL can be seen below.

How would such a client.java look like?

Particularly I am interested in the necessary import statements.

Which classes and *.jars do I have to include in the CLASSPATH minimally ?



package ttest.ws.sumtest;

import java.net.MalformedURLException;
import java.net.URL;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
import javax.xml.ws.WebEndpoint;
import javax.xml.ws.WebServiceClient;

/**
 * This class was generated by the JAX-WS RI.
 * JAX-WS RI 2.1.1-b03-
 * Generated source version: 2.0
 * 
 */
@WebServiceClient(name = "SumService", targetNamespace = "http://sumtest.ws.ttest/", wsdlLocation = "http://127.0.0.1:8777/SumDemo?wsdl")
public class SumService
    extends Service
{

    private final static URL SUMSERVICE_WSDL_LOCATION;

    static {
        URL url = null;
        try {
            url = new URL("http://127.0.0.1:8777/SumDemo?wsdl");
        } catch (MalformedURLException e) {
            e.printStackTrace();
        }
        SUMSERVICE_WSDL_LOCATION = url;
    }

    public SumService(URL wsdlLocation, QName serviceName) {
        super(wsdlLocation, serviceName);
    }

    public SumService() {
        super(SUMSERVICE_WSDL_LOCATION, new QName("http://sumtest.ws.ttest/", "SumService"));
    }

    /**
     * 
     * @return
     *     returns Sum
     */
    @WebEndpoint(name = "SumPort")
    public Sum getSumPort() {
        return (Sum)super.getPort(new QName("http://sumtest.ws.ttest/", "SumPort"), Sum.class);
    }

}


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4147010#4147010

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4147010



More information about the jboss-user mailing list