FileDocCategorySizeDatePackage
GetDataClient.javaAPI DocExample1323Wed Feb 27 11:49:00 GMT 2002javasoap.book.ch8

GetDataClient

public class GetDataClient extends Object

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


      URL url = new URL(
          "http://georgetown:8080/soap/servlet/rpcrouter");
      Call call = new Call();
      call.setTargetObjectURI("urn:CorporateDataService");
      call.setMethodName("getDataForSymbol");
      call.setEncodingStyleURI(Constants.NS_URI_LITERAL_XML);

      String symbol = "MINDSTRM";
      Vector params = new Vector();
      params.addElement(new Parameter("symbol", String.class, 
                  symbol, Constants.NS_URI_SOAP_ENC));
      call.setParams(params);

      Response resp;

      try {
         resp = call.invoke(url, "");
      }
      catch (SOAPException e) {
         System.out.println(e.getMessage());
         return;
      }

      if (!resp.generatedFault()) {
         Parameter ret = resp.getReturnValue();
         Element bookEl = (Element)ret.getValue();
         System.out.println(DOM2Writer.nodeToString(bookEl));
      }