473,396 Members | 1,847 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

ResponseSoapContext.Current is null?

I have a web service and am trying to use WSE 2.0 to pass attachments. I
have
enabled both the checkboxes in the WSE properties page in VS.

The problem occurs when I try to get the ResponseSoapContext in my service
to add the attachment.

Dim Context As SoapContext = ResponseSoapContext.Current
Dim Attachment As New DimeAttachment(Type, "text/html", Bytes)
Context.Attachments.Add(Attachment)

My problem is the ResponseSoapContext.Current is Nothing! I have no idea
why, as everything seems to be set up correctly.

And my service class:

Imports Microsoft.Web.Services2.Dime
Imports Microsoft.Web.Services2
Imports System.Net
Imports System.Web.Services
<WebService(Namespace:="http://foobar.com/")> _
Public Class ReportService
Inherits System.Web.Services.WebService

Any ideas? What should I be looking for. It seems like this ought to work.

Thanks,

-- Greg Allen
Nov 23 '05 #1
4 5645
Make sure WSE entry is properly specified in the Web.config
Regards
erymuzuan Mustapa
Greg Allen wrote:
I have a web service and am trying to use WSE 2.0 to pass attachments. I
have
enabled both the checkboxes in the WSE properties page in VS.

The problem occurs when I try to get the ResponseSoapContext in my service
to add the attachment.

Dim Context As SoapContext = ResponseSoapContext.Current
Dim Attachment As New DimeAttachment(Type, "text/html", Bytes)
Context.Attachments.Add(Attachment)

My problem is the ResponseSoapContext.Current is Nothing! I have no idea
why, as everything seems to be set up correctly.

And my service class:

Imports Microsoft.Web.Services2.Dime
Imports Microsoft.Web.Services2
Imports System.Net
Imports System.Web.Services
<WebService(Namespace:="http://foobar.com/")> _
Public Class ReportService
Inherits System.Web.Services.WebService

Any ideas? What should I be looking for. It seems like this ought to work.

Thanks,

-- Greg Allen

Nov 23 '05 #2
I think I have the right stuff in my web.config. Here's the relevant piece:

<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>
<appSettings>
</appSettings>
<microsoft.web.services2>
<diagnostics />
</microsoft.web.services2>
</configuration>

"erymuzuan" <er*******@yahoo.com> wrote in message
news:41**************@yahoo.com...
Make sure WSE entry is properly specified in the Web.config
Regards
erymuzuan Mustapa
Greg Allen wrote:
I have a web service and am trying to use WSE 2.0 to pass attachments. I have
enabled both the checkboxes in the WSE properties page in VS.

The problem occurs when I try to get the ResponseSoapContext in my service to add the attachment.

Dim Context As SoapContext = ResponseSoapContext.Current
Dim Attachment As New DimeAttachment(Type, "text/html", Bytes)
Context.Attachments.Add(Attachment)

My problem is the ResponseSoapContext.Current is Nothing! I have no idea why, as everything seems to be set up correctly.

And my service class:

Imports Microsoft.Web.Services2.Dime
Imports Microsoft.Web.Services2
Imports System.Net
Imports System.Web.Services
<WebService(Namespace:="http://foobar.com/")> _
Public Class ReportService
Inherits System.Web.Services.WebService

Any ideas? What should I be looking for. It seems like this ought to work.
Thanks,

-- Greg Allen

Nov 23 '05 #3
I forgot this in configSections:

<section name="microsoft.web.services2"
type="Microsoft.Web.Services2.Configuration.WebSer vicesConfiguration,
Microsoft.Web.Services2, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" />
</configSections>

"Greg Allen" <oe******@attbi.com> wrote in message
news:Oc**************@TK2MSFTNGP14.phx.gbl...
I think I have the right stuff in my web.config. Here's the relevant piece:
<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>
<appSettings>
</appSettings>
<microsoft.web.services2>
<diagnostics />
</microsoft.web.services2>
</configuration>

"erymuzuan" <er*******@yahoo.com> wrote in message
news:41**************@yahoo.com...
Make sure WSE entry is properly specified in the Web.config
Regards
erymuzuan Mustapa
Greg Allen wrote:
I have a web service and am trying to use WSE 2.0 to pass attachments. I have
enabled both the checkboxes in the WSE properties page in VS.

The problem occurs when I try to get the ResponseSoapContext in my service to add the attachment.

Dim Context As SoapContext = ResponseSoapContext.Current
Dim Attachment As New DimeAttachment(Type, "text/html", Bytes)
Context.Attachments.Add(Attachment)

My problem is the ResponseSoapContext.Current is Nothing! I have no idea why, as everything seems to be set up correctly.

And my service class:

Imports Microsoft.Web.Services2.Dime
Imports Microsoft.Web.Services2
Imports System.Net
Imports System.Web.Services
<WebService(Namespace:="http://foobar.com/")> _
Public Class ReportService
Inherits System.Web.Services.WebService

Any ideas? What should I be looking for. It seems like this ought to work.
Thanks,

-- Greg Allen


Nov 23 '05 #4
I'm still stuck here. But I wanted to remove my app from the equation, so
here is what
I did:

1. Created a new web service, using the VS 2003 IDE.
2. Selected properties on the web services, picked the "WSE Settings 2.0..."
option
and checked both checkmarks on the general page.
3. Verified that the web.config contains the entries for WSE.
4. In the default Service1.asmx.vb file, I uncommented the sample "Hello,
World" webmethod
and modified it so that the entire file contains this (removing the
designer generated code region):

Imports Microsoft.Web.Services2
Imports System.Web.Services

<System.Web.Services.WebService(Namespace :=
"http://tempuri.org/WebService2/Service1")> _
Public Class Service1
Inherits System.Web.Services.WebService

' WEB SERVICE EXAMPLE
' The HelloWorld() example service returns the string Hello World.
' To build, uncomment the following lines then save and build the
project.
' To test this web service, ensure that the .asmx file is the start page
' and press F5.
'
<WebMethod()> _
Public Function HelloWorld() As String
Dim X As SoapContext = ResponseSoapContext.Current
Dim Y As SoapContext = RequestSoapContext.Current
Return "Hello World"
End Function

End Class

I set a breakpoint on the return statement, run the service, then invoke the
method. At
the breakpoint, both X and Y are Nothing.

I have a feeling I am missing something very simple here. I have
re-installed WSE 2.0 SP2 and
also rebooted, but that didn't see to help.

What am I missing?

Thanks,

-- Greg Allen


"Greg Allen" <oe******@attbi.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
I have a web service and am trying to use WSE 2.0 to pass attachments. I
have
enabled both the checkboxes in the WSE properties page in VS.

The problem occurs when I try to get the ResponseSoapContext in my service
to add the attachment.

Dim Context As SoapContext = ResponseSoapContext.Current
Dim Attachment As New DimeAttachment(Type, "text/html", Bytes)
Context.Attachments.Add(Attachment)

My problem is the ResponseSoapContext.Current is Nothing! I have no idea
why, as everything seems to be set up correctly.

And my service class:

Imports Microsoft.Web.Services2.Dime
Imports Microsoft.Web.Services2
Imports System.Net
Imports System.Web.Services
<WebService(Namespace:="http://foobar.com/")> _
Public Class ReportService
Inherits System.Web.Services.WebService

Any ideas? What should I be looking for. It seems like this ought to work.
Thanks,

-- Greg Allen

Nov 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: kk | last post by:
Can any function tell the compiled program executing path? after using the program to open a file from MFC dialog box, the path changes. thks in advance.
2
by: moondaddy | last post by:
I need to set a variable to a session variable (if that's what you call it) like this: dim ds as dataset = HttpContext.Current.Session("CustDataSet") But I get an exception if this variable...
1
by: Joseph Geretz | last post by:
Why isn't the ASP.NET runtime providing a valid reference for this object to my WebService? I'm trying to use WSE and DIME to send attachments via Web Service. I've provided a whole lot of...
14
by: Tina | last post by:
My employer tracks productivity/performance of clinicians (how much they bill) each week, its averages for the month, and the 6 months. These averages are compared to their expected productivity....
0
by: Aaron Morton | last post by:
I'm working on a IHttpModule that handles the PreSendRequestHeaders event from the HttpApplication, if the event is raised after EndRequest then HttpContext.Current is null. If it is raised before...
2
by: Dave | last post by:
After some digging, I discovered HttpContext.Current.Session is null when trying to access a session variable, username, in my upload.cs code which is in the App_Code folder. I just determined...
14
by: R.A.M. | last post by:
Hello, I have created ASP.NET project in which I have a file Admin.cs. It contains static class Admin with some methods and properties. The problem is that in property get a reference...
0
by: alister7 | last post by:
hi every1 im trying to download a music file from the database SQLserver.which i upload in the database.. The Code below works fine in wen i create a new project of an ASP.Net web application..m...
3
by: Madhur | last post by:
Hello I am delivering an asp.net 2.0 application to my customer. I need to know, If I need to check for the condition of HttpContext.Current to be null in my business logic. I have extensively...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.