Hello,
I have a simple webmethod to send Dime attachments using WSE 2 :
[WebMethod]
public void CreateDimedImage()
{
SoapContext respContext = ResponseSoapContext.Current; // the problem is
here. I always have ResponseSoapContext.Current = null.
DimeAttachment dimeAttach = new DimeAttachment("image/gif",
TypeFormat.MediaType, "C:\\temp\\help.gif");
respContext.Attachments.Add(dimeAttach);
}
when I try to trace this method I see ResponseSoapContext.Current as
<undefined value>.
when I try to access method using client application, I get Exception:
An unhandled exception of type 'System.Web.Services.Protocols.SoapException'
occurred in system.web.services.dll
Additional information: System.Web.Services.Protocols.SoapException: Server
was unable to process request. ---> System.NullReferenceException: Object
reference not set to an instance of an object.
at WSPrototechnika.DimeService.CreateDimedImage() in
c:\inetpub\wwwroot\WSPrototechnika\DimeService.asmx.cs:line 68
--- End of inner exception stack trace ---
I think it is some configuration problem. I used to have WSE 1. now I
uninstalled it, but Microsoft Visual Studio still has WSE Settings and WSE 2
Settings available.
Also, I heard this can happen because of some security restriction. If so,
how can I check this?
Yedu - 17 Jun 2005 01:43 GMT
Use RequestSoapContext.Current in your webmethod.
> Hello,
>
[quoted text clipped - 37 lines]
> Also, I heard this can happen because of some security restriction. If so,
> how can I check this?
Ero - 17 Jun 2005 07:22 GMT
the same situation is with RequestSoapContext.Current. it is null ...
> Use RequestSoapContext.Current in your webmethod.
>
[quoted text clipped - 39 lines]
> > Also, I heard this can happen because of some security restriction. If so,
> > how can I check this?
François Lemaire - 24 Jun 2005 10:07 GMT
Did you insert the WSE 2.0 SOAP extension in your web.config file ? It must
look like that :
<system.web>
<webServices>
<soapExtensionTypes>
<add type="Microsoft.Web.Services2.WebServicesExtension,
Microsoft.Web.Services2, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" priority="1" group="0" />
</soapExtensionTypes>
</webServices>
</system.web>
Hope this helps...
> the same situation is with RequestSoapContext.Current. it is null ...
>
[quoted text clipped - 47 lines]
> so,
> > > how can I check this?