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

Tip: Looking for answers? Try searching our database.

Reference a SoapExtension instance from within a WebMethod?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Trevor Pinkney - 24 Feb 2005 15:37 GMT
Hi,

Is it possible to reference a custom SoapExtension instance from within a
WebMethod?

I have a SoapExtension used by several web-services for generic logging.
The SoapExtension logs the ServiceId, Soap Request, Start Time, End Time
etc. to the database.  I need to get the Id of the row the SoapExtension
inserts into
the database from within the Web Method.  (The web method sends a
text-formatted request based on the SoapRequest to an external system and
that needs to be logged in the same database row)

Has anyone had a similar problem?... and if so, how did you approach it?

-Trevor
Sami Vaaraniemi - 26 Feb 2005 08:31 GMT
> Hi,
>
[quoted text clipped - 11 lines]
>
> -Trevor

Hi,

Are you hosting the web service in IIS? If so, the SoapExtension can can
store the Id into HttpContext.Current.Cache with a known key. The web method
can then get the Id from the cache using the same key.

Regards,
Sami
Trevor Pinkney - 02 Mar 2005 21:40 GMT
Hello Sami,

Thanks for the idea but unfortunately that will cause problems with concurrent
requests because one Id may overwrite another.

"The Cache has some similarities to the Application object and is a container
of global data (as opposed to session-specific data)"

I might end up using Session though which is along the same lines.

-Trevor

>> Hi,
>>
[quoted text clipped - 22 lines]
> Regards,
> Sami
Sami Vaaraniemi - 03 Mar 2005 16:29 GMT
You are right, using the Cache you would have to handle concurrent access.
HttpContext.Current.Items, on the other hand, is per-request and should be
safe from concurrency issues.

Regards,
Sami

> Hello Sami,
>
[quoted text clipped - 34 lines]
>> Regards,
>> Sami

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.