Commit d2b42d13 LN

bug修改

1 个父辈 1e099551
...@@ -22,9 +22,8 @@ public class WSClientUtil { ...@@ -22,9 +22,8 @@ public class WSClientUtil {
httpClient.setTimeout(1000); httpClient.setTimeout(1000);
httpClient.setConnectionTimeout(1000); httpClient.setConnectionTimeout(1000);
PostMethod postMethod = new PostMethod(); PostMethod postMethod = new PostMethod();
// postMethod.setPath(url ); //路径和wsdl名 postMethod.setPath(url ); //路径和wsdl名
postMethod.setPath(url + "/ncg.wsdl"); //路径和wsdl名 // postMethod.setPath(url + "/ncg.wsdl"); //路径和wsdl名
// String soap = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" " // String soap = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" "
// + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><soapenv:Body><ns1:GetNcgOnlineInfo soapenv:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:ns1=\"urn:ncg\"/></soapenv:Body></soapenv:Envelope>"; // + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><soapenv:Body><ns1:GetNcgOnlineInfo soapenv:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:ns1=\"urn:ncg\"/></soapenv:Body></soapenv:Envelope>";
Map<String, String> headers = new HashMap<String, String>(); Map<String, String> headers = new HashMap<String, String>();
...@@ -33,20 +32,13 @@ public class WSClientUtil { ...@@ -33,20 +32,13 @@ public class WSClientUtil {
try { try {
byte[] b = soap.getBytes("utf-8"); byte[] b = soap.getBytes("utf-8");
// InputStream is = new ByteArrayInputStream(b, 0, b.length);
// RequestEntity re = new InputStreamRequestEntity(is, b.length,
// "application/soap+xml; charset=utf-8");
// postMethod.setRequestEntity(re);
if (!CollectionUtils.isEmpty(headers)) { if (!CollectionUtils.isEmpty(headers)) {
for (Map.Entry<String, String> entry : headers.entrySet()) { for (Map.Entry<String, String> entry : headers.entrySet()) {
postMethod.addRequestHeader(entry.getKey(), entry.getValue()); postMethod.addRequestHeader(entry.getKey(), entry.getValue());
} }
} }
int statusCode = httpClient.executeMethod(postMethod); int statusCode = httpClient.executeMethod(postMethod);
String soapResponseData = postMethod.getResponseBodyAsString(); String soapResponseData = postMethod.getResponseBodyAsString();
log.info("sendSoap 返回:["+statusCode+"],["+soapResponseData+"]"); log.info("sendSoap 返回:["+statusCode+"],["+soapResponseData+"]");
postMethod.releaseConnection(); postMethod.releaseConnection();
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!