Web Services???????????????
?????????? ???????[ 2010/2/20 15:58:26 ] ????????
????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://m.misscakediy.com?? ServerFailed )??
???? action parameter is null.??
???? null??
???? detail);
???? }
???? if(symbol == null) {
???? throw new SOAPFaultException(new QName(http://m.misscakediy.com?? 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://m.misscakediy.com/?? 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
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11