URL httpurl = new URL(url);
HttpURLConnection httpConn = (HttpURLConnection)httpurl.openConnection();
httpConn.setRequestMethod( "POST" );
httpConn.setRequestProperty("Host",host);
httpConn.setRequestProperty("Content-Type",contype);
httpConn.setRequestProperty( "Content-Length",String.valueOf(postStr.length()));
httpConn.setRequestProperty("SOAPAction",soapaction);
httpConn.setDoOutput(true);
httpConn.setDoInput(true);
PrintWriter out = new PrintWriter(httpConn.getOutputStream());
out.print(xml部分);
out.flush();
out.close();
BufferedReader in = new BufferedReader(new InputStreamReader(httpConn.getInputStream()));
String inputLine;
while ((inputLine = in.readLine()) != null)
{
result += inputLine+"\n";
}
in.close();
HttpURLConnection httpConn = (HttpURLConnection)httpurl.openConnection();
httpConn.setRequestMethod( "POST" );
httpConn.setRequestProperty("Host",host);
httpConn.setRequestProperty("Content-Type",contype);
httpConn.setRequestProperty( "Content-Length",String.valueOf(postStr.length()));
httpConn.setRequestProperty("SOAPAction",soapaction);
httpConn.setDoOutput(true);
httpConn.setDoInput(true);
PrintWriter out = new PrintWriter(httpConn.getOutputStream());
out.print(xml部分);
out.flush();
out.close();
BufferedReader in = new BufferedReader(new InputStreamReader(httpConn.getInputStream()));
String inputLine;
while ((inputLine = in.readLine()) != null)
{
result += inputLine+"\n";
}
in.close();
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货