调用webservice的接口之xml请求
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
public class UrlDemo {
public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub
callXml("apple");
}
public static void callXml(String word) throws Exception{
//地址
URL url = new URL("http://www.webxml.com.cn/WebServices/TranslatorWebService.asmx"<