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 / January 2007

Tip: Looking for answers? Try searching our database.

Why is my SoapContext.Current null?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Joseph Geretz - 17 Jan 2007 19:46 GMT
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(Name = "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 -
Joseph Geretz - 18 Jan 2007 03:22 GMT
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 -

>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
[quoted text clipped - 49 lines]
>
> - Joe Geretz -

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.