soap - 经典的 asp - 只接收肥皂响应的一部分
问题描述
我正在尝试从经典 asp 调用一个肥皂请求(它将在稍后更新,但现在它仍然是经典 asp),但我只得到了一半的响应?
当我在 SoapUI 中使用请求字符串时,我得到了我正在寻找的响应,但在 asp 中我只收到了部分响应?
ASP 请求:
Set oXmlHTTP = CreateObject("Microsoft.XMLHTTP")
oXmlHTTP.Open "POST", "http://webservice-string?wsdl", False
oXmlHTTP.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
oXmlHTTP.setRequestHeader "SOAPAction", "urn:action"
SOAPRequest = _
"<?xml version=""1.0"" encoding=""utf-8""?>" &_
"<soapenv:Envelope xmlns:soapenv=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:head=""http://header.com"" xmlns:ser=""http://service.com"" xmlns:add=""http://service.com/domain/address"">" &_
"<soapenv:Header>" &_
"<head:OnBehalfOfUserId>stine</head:OnBehalfOfUserId>" &_
"<head:RequestId>?</head:RequestId>" &_
"<head:AuthenticationHeader>" &_
"<head:SessionID>?</head:SessionID>" &_
"</head:AuthenticationHeader>" &_
"</soapenv:Header>" &_
"<soapenv:Body>" &_
"<ser:searchVisitationRequest>" &_
"<ser:UserId>Stine</ser:UserId>" &_
"<ser:RequestId>?</ser:RequestId>" &_
"<add:SomeId>1234</add:SomeId>" &_
"</ser:searchVisitationRequest>" &_
"</soapenv:Body>" &_
"</soapenv:Envelope>"
On Error Resume Next
oXmlHTTP.send SOAPRequest
If Err.Number Then
Err.Clear
Else
SOAPResponse = oXmlHTTP.responseXML.text
End If
On Error Goto 0
if len(SOAPResponse) > 0 then
Response.Write SOAPResponse
end if
ASP 响应:
2018-06-25T09:56:36.016+02:00server_ID{bla bla}5
SoapUI 响应
(根据相同的请求 - 包含“ SearchVisitation ”,这是我需要的结果!)
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<searchVisitationResponse xmlns="http://service.com">
<ReplyInfo>
<ReplyTimestamp>2018-06-25T08:47:48.204+02:00</ReplyTimestamp>
<ServerId>server_ID</ServerId>
<StatusMessage>{bla bla}</StatusMessage>
<TransactionDuration>3</TransactionDuration>
</ReplyInfo>
<SearchVisitation>
<OtherID>12345678</OtherID>
<SearchVisitationID>
<SubscriptionNo>Test1</SubscriptionNo>
</SearchVisitationID>
</SearchVisitation>
</searchVisitationResponse>
</S:Body>
</S:Envelope>
我究竟做错了什么?
解决方案
结果是
oXmlHTTP.setRequestHeader "SOAPAction", "urn:action"
是导致请求出错的部分(我已经 - 再次 - 三重检查urn:action
是否正确)。
删除它给了我正确的回应。
推荐阅读
- microservices - 为什么每个微服务都有自己的数据库?
- sql-server - 将特定时间连接到存储过程中的日期
- bootstrap-4 - 无法在移动视图中对齐元素
- kotlin - 由函数返回的通用枚举值数组的 Kotlin 版本是什么?
- r - qichart 和 plotly 制作列表而不是图表?
- android - 为什么 adb install 从上下文菜单中失败并出现“必须指定 apk 大小”错误?
- r - 在散点图中添加一条表示轴平均值的线
- javascript - Range Slider - 如何在 IE/Edge 上设置样式?
- c# - 选定(当前)FlyoutItem 的装扮风格
- python - 如何通过更新主行中的列来合并事务数据