当前位置:编程学习 > C#/ASP.NET >>

ResponseSoapContext.Current is null

使用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>
--------------------编程问答-------------------- 没人帮帮我吗? --------------------编程问答-------------------- 不会,帮顶
补充:.NET技术 ,  Web Services
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,