Re: WSE/DIME - ResponseSoapContext.Current = <undefined value>

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi Manfred,

I have done this. I've written a small Winforms driver which drives the Web
Service request as follows:

In Form Load, the Web Service client proxy is created:

private void frmFetchFile_Load(object sender, System.EventArgs e)
{
m_Repository = new SRSFreedom.Repository();
}

Subsequently, I attempt to retrieve the attachment:

Attachments = m_Repository.DropDIMEOnMe(txtFileSpec.Text);

This has not changed anything. I continue to get the exact same problem.
ResponseSoapContext.Current = <undefined value>.

Doesn't anyone have a solution to this? I've already uninstalled and
reinstalled my Frameworks, Service Packs, WSE 2.0.

Thanks!

- Joe Geretz -

"Manfred Gloiber" <no@xxxxxxxxx> wrote in message
news:Oj4Zoc%23rFHA.2596@xxxxxxxxxxxxxxxxxxxxxxx
> Hi Joseph,
>
> the ResponseSopaContext.Current will only be initialized if you access it
> through another winapp/webapp because only then a proxy for accessing the
> web service will be created.
>
> So simply add a test project to your solution and start the web service
> *and* the test project (or select multiple project to start if you hit run
> in the *solution* properties).
>
> You can fully debug two (or more) running process at the same time within
> the VS.NET IDE.
>
> HTH!
>
>
> --
> Manfred
>
> "Joseph Geretz" <jgeretz@xxxxxxxxxx> wrote in message
> news:%23AeGAz2rFHA.528@xxxxxxxxxxxxxxxxxxxxxxx
>> Why isn't the ASP.NET runtime providing a valid reference to the
>> ResponseSoapContext object to my WebService? I'm trying to use WSE and
>> DIME to send attachments via Web Service. I created a brand new
>> WebService project and added in the reference to WSE. I didn't modify the
>> Web.Config file myself, but when I looked I was pleasantly surprised to
>> see that all entries were added automatically for me (see Web.config file
>> below).
>>
>> Here is the Web Service method which I've defined:
>>
>> [WebMethod]
>> public int DropDIMEOnMe(string FileSpec)
>> {
>> SoapContext respContext = ResponseSoapContext.Current;
>> DimeAttachment dimeAttach = new DimeAttachment("file/unknown",
>> TypeFormat.MediaType, FileSpec);
>> respContext.Attachments.Add(dimeAttach);
>> return respContext.Attachments.Count;
>> }
>>
>> The statement
>>
>> respContext.Attachments.Add(dimeAttach);
>>
>> trips the following error:
>>
>> Object reference not set to an instance of an object.
>>
>> The crux of the problem is that ResponseSoapContext.Current = <undefined
>> value> when I attempt to access it. Why am I unable to get access to the
>> ResponseSoapContext object?
>>
>> Thanks for any assistance which you can provide!
>>
>> - Joe Geretz -
>>
>> Here's my Web.Config file:
>>
>> <?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,
>> PublicKeyToken=31bf3856ad364e35" />
>> </configSections>
>> <system.web>
>> <compilation defaultLanguage="c#" debug="true" />
>> <customErrors mode="RemoteOnly" />
>> <authentication mode="Windows" />
>> <authorization>
>> <allow users="*" />
>> </authorization>
>> <trace enabled="false" requestLimit="10" pageOutput="false"
>> traceMode="SortByTime" localOnly="true" />
>> <sessionState mode="InProc"
>> stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data
>> source=127.0.0.1;Trusted_Connection=yes" cookieless="false" timeout="20"
>> />
>> <globalization requestEncoding="utf-8" responseEncoding="utf-8" />
>> <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>
>> <microsoft.web.services2>
>> <diagnostics />
>> </microsoft.web.services2>
>> </configuration>
>>
>>
>>
>
>


.



Relevant Pages

  • Re: Urgent: Webservice method not recognizing parameters
    ... create a test project and set a reference to the web service? ... So> that's why I am testing a soap script with it. ... then>> why are you not using ASP.NET to expose the web service? ... I get the Object reference not set to an instance of the object>>> error. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: WSE/DIME - ResponseSoapContext.Current =
    ... So simply add a test project to your solution and start the web service ... > ResponseSoapContext object to my WebService? ... > project and added in the reference to WSE. ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • VS2008 and testing web services
    ... I have a C# web service that I'd like to test. ... I added a test project to the ... The Web request 'http://localhost:1828/ ' completed successfully without ... Running tests in ASP.NET requires the URL ...
    (microsoft.public.vsnet.general)
  • Testing web services
    ... I have a C# web service that I'd like to test. ... I added a test project to the ... The Web request 'http://localhost:1828/ ' completed successfully without ... Running tests in ASP.NET requires the URL ...
    (microsoft.public.dotnet.languages.csharp)
  • XsdObjectGen classes in Web Service Client Proxy
    ... XsdObjectGen classes in Web Service Client Proxy ... Does anyone know how I can get a web service client proxy to use classes ...
    (microsoft.public.dotnet.framework.aspnet.webservices)