我正在嘗試使用發送 SOAP 請求requests.post,但出現以下錯誤。
Content-ID: <http://tempuri.org/0>
Content-Transfer-Encoding: 8bit
Content-Type: application/xop xml;charset=utf-8;type="text/xml"
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<s:Fault>
<faultcode xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">
a:DeserializationFailed
</faultcode>
<faultstring xml:lang="en-AU">
The formatter threw an exception while trying to
deserialize the message: There was an error while trying to deserialize parameter
http://tempuri.org/:Data. The InnerException message was 'There was an error
deserializing the object of type
System.Collections.Generic.List`1[[Blue.Integration.IDataRow, Blue.Integration,
Version=7.20.1.56190, Culture=neutral, PublicKeyToken=null]]. The 'maximum bytes per Read
operation' quota (4096) has been exceeded while reading XML data. Long element start tags
(consisting of the element name, attribute names and attribute values) may trigger
this quota.
This quota may be increased by changing the MaxBytesPerRead property on the
XmlDictionaryReaderQuotas object used when creating the XML reader. Line 71, position
48.'.
Please see InnerException for more details.
</faultstring>
</s:Fault>
</s:Body>
</s:Envelope>
服務提供商告訴我,我應該按照此鏈接上的說明進行操作。
這是requests不能做的事情嗎?我應該使用zeep嗎?在任何一種情況下,在 Python 中MaxBytesPerRead更改屬性的示例XmlDictionaryReaderQuotas都會非常有幫助。謝謝!
uj5u.com熱心網友回復:
這個錯誤來自服務的提供者,他們應該在 web.config 中的 BasicHttpBinding 中調整 MaxBytesPerRead。在您的呼叫服務中,您無能為力。
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/512557.html
上一篇:WCF-跟蹤日志記錄-將ActivityId添加到肥皂標頭導致錯誤
下一篇:錯誤:PlatformNotSupportedException:不支持組態檔或.NETCore6如何使用SOAP.NETFrameworkwcf
