经典的 asp - 只接收肥皂响应的一部分 [英] Classic asp - only receiving part of soap response

查看:14
本文介绍了经典的 asp - 只接收肥皂响应的一部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从经典 asp 调用一个肥皂请求(它将在稍后更新,但现在它仍然是经典 asp),但我只得到了一半的响应?
当我在 SoapUI 中使用请求字符串时,我得到了我正在寻找的响应,但在 asp 中我只收到了部分响应?

I am trying to call a soap request from classic asp (it will be updated at some later point, but for now it stays classic asp), but I'm only getting half of the response?
When I use the request string in SoapUI, I get the response I'm looking for, but in asp I only receive part of the response??

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

ASP Response:

2018-06-25T09:56:36.016+02:00server_ID{bla bla}5

(来自相同的请求 - 包含SearchVisitation",这是我需要的结果!)

(made from same request - contains "SearchVisitation" which is the result I need!)

<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 是否正确).

was the part that would cause the request to error (I've - again - triple checked that the urn:action was correct).

删除它给了我正确的回应.

Removing it gave me the correct response.

这篇关于经典的 asp - 只接收肥皂响应的一部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆