FileDocCategorySizeDatePackage
WholesalerClient.javaAPI DocExample3943Tue May 29 16:57:50 BST 2007pricequote.wholesaler.client

WholesalerClient

public class WholesalerClient extends Object
author
Arun Gupta

Fields Summary
WebServiceContext
wsc
WholesalerPortType
port
Constructors Summary
public WholesalerClient(String endpoint, QName name)

        try {
            WholesalerQuoteService service = new WholesalerQuoteService(new URL(endpoint), name);
            port = service.getWholesalerPort();
        } catch (MalformedURLException e) {
            throw new WebServiceException(e);
        }
    
Methods Summary
public WholesalerPortTypegetBindingProvider()

        return port;
    
public QuotegetQuote(int pid)

        return port.getQuote(pid);
    
public static voidmain(java.lang.String[] args)

         
        String endpoint = "http://localhost:8080/pricequote/wholesaler?wsdl";
        String serviceName = "WholesalerQuoteService";

        String wqs = System.getProperty("wqs");
        if (wqs != null && wqs.equals("ms")) {
            System.out.println("Setting Wholesale Quote Service #2 endpoints");
            String ep = System.getProperty("wqs.endpoint");
            if (ep != null && !ep.equals(""))
                endpoint = ep;
            String sn = System.getProperty("wqs.serviceName");
            if (sn != null && !sn.equals(""))
                serviceName = sn;
        }

        System.out.println("Using endpoints ...");
        System.out.println("endpoint: " + endpoint);
        System.out.println("serviceName: " + serviceName);
        System.out.println(new WholesalerClient(endpoint, new QName("http://example.org/wholesaler", serviceName)).getQuote(10).getPrice());