通过发送soap请求
URL url=new URL("webservice地址");URLConnection urlConnection=url.openConnection();HttpURLConnection httpUrlConnection=(HttpURLConnection)urlConnection;httpUrlConnection.setReadTimeout(100000);httpUrlConnection.setDoOutput(true);httpUrlConnection.setDoInput(true);httpUrlConnection.setRequestMethod("POST");httpUrlConnection.setRequestProperty("SOAPAction", "对应wsdl里SOAPAction");httpUrlConnection.setRequestProperty("Content-Type", "text/xml;charset=utf-8");httpUrlConnection.setUseCaches(true);httpUrlConnection.connect();OutputStream out=httpUrlConnection.getOutputStream();out.write(0);out.flush();InputStream in=httpUrlConnection.getInputStream();in.read();httpUrlConnection.disconnect();
?