資源簡介
下載axis2-1.7.4-bin.zip,lib目錄下的jar包是WebService業務開發需要的庫文件
代碼片段和文件信息
/*
?*?Licensed?to?the?Apache?Software?Foundation?(ASF)?under?one
?*?or?more?contributor?license?agreements.?See?the?NOTICE?file
?*?distributed?with?this?work?for?additional?information
?*?regarding?copyright?ownership.?The?ASF?licenses?this?file
?*?to?you?under?the?Apache?License?Version?2.0?(the
?*?“License“);?you?may?not?use?this?file?except?in?compliance
?*?with?the?License.?You?may?obtain?a?copy?of?the?License?at
?*
?*?http://www.apache.org/licenses/LICENSE-2.0
?*
?*?Unless?required?by?applicable?law?or?agreed?to?in?writing
?*?software?distributed?under?the?License?is?distributed?on?an
?*?“AS?IS“?BASIS?WITHOUT?WARRANTIES?OR?CONDITIONS?OF?ANY
?*?KIND?either?express?or?implied.?See?the?License?for?the
?*?specific?language?governing?permissions?and?limitations
?*?under?the?License.
?*/
package?samples.databinding;
import?org.apache.axiom.om.OMAbstractFactory;
import?org.apache.axiom.om.OMDocument;
import?org.apache.axiom.om.OMElement;
import?org.exolab.castor.xml.Marshaller;
import?org.exolab.castor.xml.UnmarshalHandler;
import?org.exolab.castor.xml.Unmarshaller;
import?org.xml.sax.ContentHandler;
import?org.xml.sax.SAXException;
import?samples.databinding.data.GetStockQuote;
import?samples.databinding.data.GetStockQuoteResponse;
import?javax.xml.transform.TransformerException;
import?javax.xml.transform.TransformerFactory;
import?javax.xml.transform.sax.SAXResult;
public?final?class?StockClient?{
????public?static?void?main(String[]?args)?throws?Exception?{
????????if?(args.length?!=?2)?{
????????????System.err.println(“Usage:?StockClient??“);
????????????return;
????????}
????????final?String?url?=?args[0];
????????final?String?symbol?=?args[1];
????????System.out.println();
????????System.out.println(“Getting?Stock?Quote?for?“?+?symbol);
????????StockQuoteServiceStub?stub?=
????????????????new?StockQuoteServiceStub(url);
????????stub._getServiceClient().getOptions().setAction(“getStockQuote“);
????????GetStockQuote?stockQuote?=?new?GetStockQuote();
????????stockQuote.setSymbol(symbol);
????????OMDocument?document?=?OMAbstractFactory.getOMFactory().createOMDocument();
????????Marshaller.marshal(stockQuote?document.getSAXResult().getHandler());
????????OMElement?response?=?stub.getStockQuote(
????????????????document.getOMDocumentElement());
????????Unmarshaller?unmarshaller?=?new?Unmarshaller(GetStockQuoteResponse.class);
????????UnmarshalHandler?unmarshalHandler?=?unmarshaller.createHandler();
????????GetStockQuoteResponse?stockQuoteResponse;
????????try?{
????????????ContentHandler?contentHandler?=?Unmarshaller.getContentHandler(unmarshalHandler);
????????????TransformerFactory.newInstance().newTransformer().transform(response.getSAXSource(false)?new?SAXResult(contentHandler));
????????????stockQuoteResponse?=?(GetStockQuoteResponse)?unmarshalHandler.getobject();
????????}?catch?(SAXException?e)?{
????????????throw?new?RuntimeException(e);
????????}?catch?(TransformerException?e)?{
????????????throw?new?RuntimeExce
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????????0??2018-03-14?10:58??新建文本文檔.txt
?????目錄???????????0??2017-11-21?00:20??axis2-1.7.7\
?????目錄???????????0??2017-11-21?00:18??axis2-1.7.7\repository\services\
?????文件???????11378??2017-11-21?00:18??axis2-1.7.7\repository\modules\axis2-jaxws-mar-1.7.7.mar
?????文件???????15187??2017-11-21?00:18??axis2-1.7.7\repository\modules\mtompolicy-1.7.7.mar
?????文件??????????18??2017-11-21?00:18??axis2-1.7.7\repository\services\services.list
?????目錄???????????0??2017-11-21?00:20??axis2-1.7.7\bin\
?????文件????????2822??2017-11-20?23:35??axis2-1.7.7\bin\wsdl2java.bat
?????文件????????3480??2017-11-20?23:35??axis2-1.7.7\bin\setenv.sh
?????文件?????????666??2017-11-20?23:35??axis2-1.7.7\conf\axis2.policy
?????文件???????16834??2017-11-20?23:34??axis2-1.7.7\lib\activation-LICENSE.txt
?????文件???????11358??2017-11-20?23:34??axis2-1.7.7\lib\axis2-LICENSE.txt
?????文件???????11560??2017-11-20?23:34??axis2-1.7.7\lib\commons-fileupload-LICENSE.txt
?????文件???????11358??2017-11-20?23:34??axis2-1.7.7\lib\geronimo-annotation-LICENSE.txt
?????文件???????11359??2017-11-20?23:34??axis2-1.7.7\lib\geronimo-stax-api-LICENSE.txt
?????文件???????11560??2017-11-20?23:34??axis2-1.7.7\lib\httpcore-LICENSE.txt
?????文件????????1612??2017-11-20?23:34??axis2-1.7.7\lib\jaxen-LICENSE.txt
?????文件????????1489??2017-11-20?23:34??axis2-1.7.7\lib\jibx-run-LICENSE.txt
?????文件???????16834??2017-11-20?23:34??axis2-1.7.7\lib\mail-LICENSE.txt
?????文件???????11358??2017-11-20?23:34??axis2-1.7.7\lib\woden-core-LICENSE.txt
?????文件???????11358??2017-11-20?23:34??axis2-1.7.7\lib\xm
?????文件????????1982??2017-11-20?23:34??axis2-1.7.7\README-std-bin.txt
?????文件???????11359??2017-11-20?23:34??axis2-1.7.7\LICENSE.txt
?????目錄???????????0??2017-11-20?23:35??axis2-1.7.7\samples\databinding\client\src\
?????目錄???????????0??2017-11-20?23:35??axis2-1.7.7\samples\databinding\service\
?????目錄???????????0??2017-11-21?00:20??axis2-1.7.7\samples\faulthandling\
?????目錄???????????0??2017-11-20?23:35??axis2-1.7.7\samples\faulthandling\docs\
?????目錄???????????0??2017-11-21?00:20??axis2-1.7.7\samples\java_first_jaxws\
?????目錄???????????0??2017-11-20?23:35??axis2-1.7.7\samples\java_first_jaxws\src\main\demo\hw\
?????目錄???????????0??2017-11-20?23:35??axis2-1.7.7\samples\java_first_jaxws\src\webapp\WEB-INF\classes\
?????目錄???????????0??2017-11-20?23:35??axis2-1.7.7\samples\jaxws-addressbook\src\org\apache\
............此處省略793個文件信息
- 上一篇:安卓屏幕錄像,可錄制內部聲音
- 下一篇:亮劍Java項目開發案例導航 源代碼
評論
共有 條評論