Bootstrap

java发送soap报文_java代码请求SOAP

1 package com.http.soap;

2

3 import java.io.BufferedReader;

4 import java.io.IOException;

5 import java.io.InputStreamReader;

6 import java.nio.charset.Charset;

7

8 import org.apache.http.HttpEntity;

9 import org.apache.http.client.ClientProtocolException;

10 import org.apache.http.client.config.RequestConfig;

11 import org.apache.http.client.methods.CloseableHttpResponse;

12 import org.apache.http.client.methods.HttpPost;

13 import org.apache.http.entity.StringEntity;

14 import org.apache.http.impl.client.CloseableHttpClient;

15 import org.apache.http.impl.client.HttpClientBuilder;

16 import org.apache.http.util.EntityUtils;

17

18 public class HttpPostToSoap {

19 static int socketTimeout = 10000;// 请求超时时间

20 static int connectTimeout = 10000;// 传输超时时间

21 sta

;