?? dynamicclientexampletest.java
字號:
package org.codehaus.xfire.aegis.example;import java.net.MalformedURLException;import java.net.URL;import junit.framework.TestCase;import org.codehaus.xfire.client.Client;import org.codehaus.xfire.util.DOMUtils;import org.w3c.dom.Document;public class DynamicClientExampleTest extends TestCase{ public void SKIPtestCurrencyConverter() throws MalformedURLException, Exception { Client client = new Client(new URL("http://www.webservicex.net/CurrencyConvertor.asmx?WSDL")); Object[] results = client.invoke("ConversionRate", new Object[] {"BRL", "UGX"}); // Service returns a double of the currency conversion rate. System.out.println((Double) results[0]); } public void SKIPtestWeatherForecast() throws MalformedURLException, Exception { Client client = new Client(new URL("http://www.webservicex.net/WeatherForecast.asmx?WSDL")); Object[] results = client.invoke("GetWeatherByZipCode", new Object[] {"49506"}); // The response is a complex type which we don't know how to represent. // So XFire converts it into a org.w3c.dom.Document. You can then navigate // the document and find the desired information. DOMUtils.writeXml((Document) results[0], System.out); }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -