![](/img/trans.png)
[英]Microsoft.Web.Services3.ResponseProcessingException
[英]Microsoft.Web.Services2.SoapClient.SendRequestResponse timing out even though the server is responding with a SOAP message
據我了解,發布已學到的一些有用信息的最佳方法是親自提出問題,然后再回答,所以就到這里了。
場景:
SoapClient.SendRequestResponse知道傳出請求SOAP標頭中的MessageID,並且直到收到包含與原始MessageID匹配的RelatesTo值的消息后,才能完成調用。 因此,如果您要設計響應者/存根,則需要從請求中解析出MessageID並將其注入到響應的SOAP標頭中的RelatesTo字段中。
奇怪的是,它不只是在任何有效的SOAP消息之后返回並由於不匹配而引發期望。 也許這是SOAP Web服務標准的一部分。 我沒有調查。
例:
請求:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance/" xmlns:xsd="http://www.w3.org/2001/XMLSchema/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility">
<soap:Header>
<wsa:MessageID soap:mustUnderstand="1">uuid:20E6C5D8-2E0D-48D0-863D-7789D2CA37A2</wsa:MessageID>
...
響應:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility">
<soap:Header>
<wsa:MessageID SOAP-ENV:mustUnderstand="1" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">uuid:bb1cf43050739c45:248138d0:1328e31d4e2:-5cf4</wsa:MessageID>
<wsa:RelatesTo RelationshipType="wsa:Reply" SOAP-ENV:mustUnderstand="1" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">uuid:20E6C5D8-2E0D-48D0-863D-7789D2CA37A2</wsa:RelatesTo>
...
RelatesTo值與請求中的MessageID值相同。 響應中的MessageID是新的且唯一,因為響應消息不是請求消息。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.