Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / June 2005

Tip: Looking for answers? Try searching our database.

ResponseSoapContext

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ero - 15 Jun 2005 09:35 GMT
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?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.