Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit d2b42d13
由
LN
编写于
2022-05-24 14:29:36 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
bug修改
1 个父辈
1e099551
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
2 行增加
和
10 行删除
src/main/java/com/neotel/smfcore/siemens/util/WSClientUtil.java
src/main/java/com/neotel/smfcore/siemens/util/WSClientUtil.java
查看文件 @
d2b42d1
...
@@ -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!
Cancel
请
注册
或
登录
后发表评论