使用WSE传输附件
可ResponseSoapContext.Current一直为NULL。不是很理解,望高人指教!DocAttachment docInfo = _controller.GetDocInfo(sendAttId);
Stream ms = new MemoryStream(docInfo.Content);
SoapContext respContext = ResponseSoapContext.Current;
DimeAttachment dimeAttach = new DimeAttachment(
"image/jpg", TypeFormat.MediaType, ms);//image/jpg
respContext.Attachments.Add(dimeAttach);
return docInfo.Extension;
webcofig已添加<webServices>
<soapExtensionTypes>
<add type="Microsoft.Web.Services2.WebServicesExtension, Microsoft.Web.Services2, Version=2.0.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" priority="1" group="0"/>
</soapExtensionTypes>
</webServices>
可ResponseSoapContext.Current一直为NULL。不是很理解,望高人指教!DocAttachment docInfo = _controller.GetDocInfo(sendAttId);
Stream ms = new MemoryStream(docInfo.Content);
SoapContext respContext = ResponseSoapContext.Current;
DimeAttachment dimeAttach = new DimeAttachment(
"image/jpg", TypeFormat.MediaType, ms);//image/jpg
respContext.Attachments.Add(dimeAttach);
return docInfo.Extension;
webcofig已添加<webServices>
<soapExtensionTypes>
<add type="Microsoft.Web.Services2.WebServicesExtension, Microsoft.Web.Services2, Version=2.0.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" priority="1" group="0"/>
</soapExtensionTypes>
</webServices>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货