【发布时间】:2019-09-05 13:40:53
【问题描述】:
使用HttpWebRequest,我使用以下代码请求soap并获取流:
XmlDocument soapEnvelopeXml = new XmlDocument();
HttpWebRequest webRequest = ...
using (Stream stream = webRequest.GetRequestStream())
{
soapEnvelopeXml.Save(stream);
}
虽然这是错误消息:
Either ContentLength must be set to a non-negative number, or SendChunked set to true in order to perform the write operation when AllowWriteStreamBuffering is disabled.
正如上面的消息所说,我无法写入流,因为如果我调用 save soapEvelopeXml 应用程序将结束。
【问题讨论】:
标签: c# soap stream httpwebrequest xmldocument