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 / February 2005

Tip: Looking for answers? Try searching our database.

WSE 2.0 - ResponseSoapContext.Current is NULL

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sam Santiago - 16 Feb 2005 23:11 GMT
Has anyone come across the problem where the ResponseSoapContext.Current is null?  I have configured the WSE using the Visual Studio add-in and it has modified the web.config as follows:

 <?xml version="1.0" encoding="utf-8"?>
 <configuration>
   <configSections>
     <section name="microsoft.web.services2" type="Microsoft.Web.Services2.Configuration.WebServicesConfiguration, Microsoft.Web.Services2, Version=2.0.0.0, Culture=neutral, PublicKeyToken1bf3856ad364e35" />
   </configSections>
   <system.web>
     <webServices>
       <soapExtensionTypes>
         <add type="Microsoft.Web.Services2.WebServicesExtension, Microsoft.Web.Services2, Version=2.0.0.0, Culture=neutral, PublicKeyToken1bf3856ad364e35" priority="1" group="0" />
       </soapExtensionTypes>
     </webServices>
   </system.web>
   <microsoft.web.services2>
     <diagnostics />
   </microsoft.web.services2>
 </configuration>

The code is quite simple.  It just tries to add an attachment to the message:

 private void AttachBinaryToResponse(string key, string completeBinPath){

     SoapContext respContext = ResponseSoapContext.Current;  // Comes back as null.

     DimeAttachment dimeAttach = new DimeAttachment(key, "applications/octet-stream", TypeFormat.AbsoluteUri, completeBinPath);

     // And because SoapContext is null this of course throws an exception:

     // Object reference not set to an instance of an object.

     respContext.Attachments.Add(dimeAttach);

 }

Any tips greatly appreciated.

Thanks,

Sam

Signature

_______________________________
Sam Santiago
ssantiago@n0spam-SoftiTechture.com
http://www.SoftiTechture.com
_______________________________

Sam Santiago - 17 Feb 2005 08:08 GMT
Never mind ;-).  I was trying a quick test from the web page Visual Studio generates with the service methods, so apparently no SoapContext is present.  After I wrote a small tester client that derived the generated proxy class from the WebServicesClientProtocol class and invoked the method all worked as anticipated.

Thanks,

Sam
 Has anyone come across the problem where the ResponseSoapContext.Current is null?  I have configured the WSE using the Visual Studio add-in and it has modified the web.config as follows:

   <?xml version="1.0" encoding="utf-8"?>
   <configuration>
     <configSections>
       <section name="microsoft.web.services2" type="Microsoft.Web.Services2.Configuration.WebServicesConfiguration, Microsoft.Web.Services2, Version=2.0.0.0, Culture=neutral, PublicKeyToken1bf3856ad364e35" />
     </configSections>
     <system.web>
       <webServices>
         <soapExtensionTypes>
           <add type="Microsoft.Web.Services2.WebServicesExtension, Microsoft.Web.Services2, Version=2.0.0.0, Culture=neutral, PublicKeyToken1bf3856ad364e35" priority="1" group="0" />
         </soapExtensionTypes>
       </webServices>
     </system.web>
     <microsoft.web.services2>
       <diagnostics />
     </microsoft.web.services2>
   </configuration>

 The code is quite simple.  It just tries to add an attachment to the message:

   private void AttachBinaryToResponse(string key, string completeBinPath){

       SoapContext respContext = ResponseSoapContext.Current;  // Comes back as null.

       DimeAttachment dimeAttach = new DimeAttachment(key, "applications/octet-stream", TypeFormat.AbsoluteUri, completeBinPath);

       // And because SoapContext is null this of course throws an exception:

       // Object reference not set to an instance of an object.

       respContext.Attachments.Add(dimeAttach);

   }

 Any tips greatly appreciated.

 Thanks,

 Sam

 --
 _______________________________
 Sam Santiago
 ssantiago@n0spam-SoftiTechture.com
 http://www.SoftiTechture.com
 _______________________________

Rate this thread:







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.