473,387 Members | 1,520 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,387 software developers and data experts.

Why is my SoapContext.Current null?

I have a web service page which uses WSE 2.0 SP3 to return a file attachment
on one of its method calls. All web service methods are functioning
properly, except for this one method which uses WSE / DIME to attach the
file to SoapContext.Current. I've traced into the problem running the page
in the IDE and I'm finding that the problem is that this object is null.
SoapContext is a valid object, but the Current object is null.

My environment:

IIS 5
..NET Framework 2.0
WSE 2.0 / SP3
Visual Studio 2005 (C#)

Here's my WebService class definition:

[WebService(Namespace="http://srssoft.com/webservices/")]
[System.Web.Services.WebServiceBindingAttribute(Nam e = "RepositorySoap",
Namespace = "http://srssoft.com/webservices/")]
public class Repository : Microsoft.Web.Services2.WebServicesClientProtocol
{ ...

(I never had the WebServiceBindingAttribute coded until I moved from Fx 1.1
to Fx 2.0. The code compiled cleanly without it, but I started receiving
run-time errors which I managed to squelch by placing this attribute onto
the class. But maybe this somehow affects whether I get
SoapContext.Current?)

Also, should the Web Services class be inheriting ffrom
Microsoft.Web.Services2.WebServicesClientProtocol? That doesn't sound right
to me, since this is a Server, rather than a Client class, but I checked
back in Source Safe and this has been the definition since the class was
originally developed and it was previously working, as far as I know.

Here's the Web method call:

[WebMethod]
public int GetFile(string FileSpec, bool Checkout, string AuthentiKey)
{...

I'm also finding in the client class which initiates this call, that
RequestSoapContext.Current is also a null object before initiating a Web
request to upload a file. Clearly my infrastructure is deficient in some way
and I'm not able to get access to either the Request or Response contexts I
need to set up the DIME attachment passing between client and server. Any
idea what's wrong with my either my environment or my code?

Thanks immensely for any help which you can provide!

- Joe Geretz -
Jan 17 '07 #1
1 4965
Forget it.

WSE 2.0 DIME is dead - long live WSE 3.0 MTOM!

Because I don't want to go through another such conversion anytime soon!!!

- Joe Geretz -

"Joseph Geretz" <jg*****@nospam.comwrote in message
news:uM**************@TK2MSFTNGP06.phx.gbl...
>I have a web service page which uses WSE 2.0 SP3 to return a file
attachment on one of its method calls. All web service methods are
functioning properly, except for this one method which uses WSE / DIME to
attach the file to SoapContext.Current. I've traced into the problem
running the page in the IDE and I'm finding that the problem is that this
object is null. SoapContext is a valid object, but the Current object is
null.

My environment:

IIS 5
.NET Framework 2.0
WSE 2.0 / SP3
Visual Studio 2005 (C#)

Here's my WebService class definition:

[WebService(Namespace="http://srssoft.com/webservices/")]
[System.Web.Services.WebServiceBindingAttribute(Nam e = "RepositorySoap",
Namespace = "http://srssoft.com/webservices/")]
public class Repository :
Microsoft.Web.Services2.WebServicesClientProtocol
{ ...

(I never had the WebServiceBindingAttribute coded until I moved from Fx
1.1 to Fx 2.0. The code compiled cleanly without it, but I started
receiving run-time errors which I managed to squelch by placing this
attribute onto the class. But maybe this somehow affects whether I get
SoapContext.Current?)

Also, should the Web Services class be inheriting ffrom
Microsoft.Web.Services2.WebServicesClientProtocol? That doesn't sound
right to me, since this is a Server, rather than a Client class, but I
checked back in Source Safe and this has been the definition since the
class was originally developed and it was previously working, as far as I
know.

Here's the Web method call:

[WebMethod]
public int GetFile(string FileSpec, bool Checkout, string AuthentiKey)
{...

I'm also finding in the client class which initiates this call, that
RequestSoapContext.Current is also a null object before initiating a Web
request to upload a file. Clearly my infrastructure is deficient in some
way and I'm not able to get access to either the Request or Response
contexts I need to set up the DIME attachment passing between client and
server. Any idea what's wrong with my either my environment or my code?

Thanks immensely for any help which you can provide!

- Joe Geretz -


Jan 18 '07 #2

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

Similar topics

0
by: msnews.microsoft.com | last post by:
Hi All, I tried to use the following Microsoft sample http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wse/html/gxaconaddingattachmentstosoapmessageusingdime.asp and this is...
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...
0
by: Ash | last post by:
I am using WSE 2.0 on a .NET framework 1.1 I am creating a UsernameToken and encrypting it on a .aspx page. I am calling a webservice which in turn calls another webservice but by the time the...
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.