這似乎應該很簡單,但也許我錯過了一些東西。我只想在Java中進行SOAP調用,最好只使用內置的API。在Java文檔中查看javax.xml.soap包,我有點不知所措。我試圖搜索谷歌,但似乎所有的結果都是從2000年到2002年,他們都在談論可用於SOAP調用的庫(我猜想在構建SOAP庫之前)。如何在Java中進行SOAP調用
我不需要處理SOAP請求;只做一個。 This site有一個非常簡單的例子,但它不使用內置的Java SOAP庫。如何使用核心Java基本上做同樣的事情?
// Create the parameters
Vector params = new Vector();
params.addElement(
new Parameter("flightNumber", Integer.class, flightNumber, null));
params.addElement(
new Parameter("numSeats", Integer.class, numSeats, null));
params.addElement(
new Parameter("creditCardType", String.class, creditCardType, null));
params.addElement(
new Parameter("creditCardNumber", Long.class, creditCardNum, null));
// Create the Call object
Call call = new Call();
call.setTargetObjectURI("urn:xmltoday-airline-tickets");
call.setMethodName("buyTickets");
call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
call.setParams(params);
// Invoke
Response res = call.invoke(new URL("http://rpc.middleearth.com"), "");
// Deal with the response
找到<網絡> -name肥皂-mtime <過去十年> -print | xargs rm -r – sixtyfootersdude 2010-02-01 23:20:10