????Web Services????Ч?????????????????????????????????????????????? Web Services???????

??????????Web Services?????????????????????????????????е??????????????WSDL????????????????????????????????Э??淶????HTTP1.1???????Э?饗??SOAP 1.1??????????????????????÷????WSDL????е???????????????????????????????????????????????????????????UDDI?????????????????μ???????????????????????????????????????????顣

Web Services??????????????????????????????????????????Щ????????л?????????????????????????к???????Web Services????????????????????????????????????????XML????????????????????????????Ч???????Щ?????????GUI??????????????????Ч?????Web Services??????????????

???????

?ò?????????????????????????????????????????????????????????????Web Services???????????????????????????????????????Web Services???????????????????????????????????????????п????????????????У?????????????????????б?磬???????????????????????????????Χ?????????????????????????

????  public boolean execute(String action?? String symbol?? int quantity)

????  throws javax.xml.soap.SOAPException{

????     Detail detail = null;

????     detail = SOAPFactory.newInstance().createDetail();

????     detail.addChildElement( Stock Trade ).addTextNode( failed );

????      System.out.println(execute() in webservices.stock.trade webservice has been invoked

????      with following arguments:: action: action

????      symbol: symbol quantity: quantity);

????      if(action == null) {

????        throw new SOAPFaultException(new QName(http://hgh666.cn?? ServerFailed )??

????              action parameter is null.??

????              null??

????              detail);

????      }

????      if(symbol == null) {

????        throw new SOAPFaultException(new QName(http://hgh666.cn?? ServerFailed )??

????              symbol parameter is null.??

????              null??

????              detail);

????   }
if(action.equalsIgnoreCase(BUY))

????        System.out.println(BUYING quantity: quantity of symbol: symbol);

????        // Invoke method to execute trade here.

????      else if(action.equalsIgnoreCase(SELL))

????        System.out.println(SELLING quantity: quantity of symbol: symbol);

????        // Invoke method to execute trade here.

????      else

????      {

????        System.out.println(INVALID action: action);

????        throw new SOAPFaultException(new QName( http://hgh666.cn/?? ServerFailed )??

????              Invalid Action: action??

????              null??

????              detail);

????      }

????      return true;

????    }


 

 

????????????????Stock Trade Web Services???execute()???????????????÷?????????????????????Ч?????????????й????????????????????action????????????????SoapFaultException??????faultstring??????????????????????????????????????????????? symbol???????????????Web Services??????????????????????£?????????????λ????????

???? 

try{

????       // Setup the global JAXM message factory

????       System.setProperty(javax.xml.soap.MessageFactory??

????         weblogic.webservice.core.soap.MessageFactoryImpl);

????       // Setup the global JAX-RPC service factory

????       System.setProperty( javax.xml.rpc.ServiceFactory??

????         weblogic.webservice.core.rpc.ServiceFactoryImpl);

????       StockTrade_Impl ws = new StockTrade_Impl();

????       StockTradePort port  = ws.getStockTradePort();

????       boolean returnVal = port.execute(action?? symbol?? quantity);

????       System.out.println(The webservice got back the following result: returnVal);

????      }catch(Exception e) {

????      }


????????????Stock Trade Web Services