473,396 Members | 2,011 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.

Reference a SoapExtension instance from within a WebMethod?

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
Nov 23 '05 #1
3 3587

"Trevor Pinkney" <tp******@cyence.com> wrote in message
news:16********************@news.microsoft.com...
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


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
Nov 23 '05 #2
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

"Trevor Pinkney" <tp******@cyence.com> wrote in message
news:16********************@news.microsoft.com...
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

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


Nov 23 '05 #3
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

"Trevor Pinkney" <tp******@cyence.com> wrote in message
news:35********************@news.microsoft.com...
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

"Trevor Pinkney" <tp******@cyence.com> wrote in message
news:16********************@news.microsoft.com...
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

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


Nov 23 '05 #4

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

Similar topics

1
by: Dave Buxbaum via .NET 247 | last post by:
Hi, I have a SoapExtension that adds a SoapHeader to all outboundmessages. This works fine, but I don't see a way to control thenamespace of the emitted header. Here is what I'm doing: I have...
1
by: alex bean | last post by:
How do i get them value of the web service namespace from inside a SoapExtension? For example my web service is defiend as: public class MyTest: WebService { public string HelloWorld(y)
2
by: SP | last post by:
Hello All, I have a web method in a web service as follows: public SqlDataReader Display_test_data() { string connectionInfo = ConfigurationSettings.AppSettings;
0
by: jgrant | last post by:
Hi I am pretty new in SoapExtension so I will like to know if there is any "Hello World" example that uses SoapExtension and with Xsd for a WebMethod. Thanks.
2
by: lprisr | last post by:
Hi, I have double byte characters in the content that I am returning using Web Services. However, the encoding in the xml file returned by Web Services is utf-8 and I am unable to read the...
10
by: Andy Kendall | last post by:
I have a problem accessing my custom SoapHeader from a SoapExtension. My extension has no compile time reference to the class derived from SoapHeader, so how can cast it into a SoapHeader of the...
0
by: Madhu Kumar | last post by:
Hi, I am working in C# web services. In my web service i included a soapextension class(ya attribute class too). using a client application i tried to consume the web method but error: 'Response...
2
by: John | last post by:
I'm calling the Webmethod from JS and at the end of the function I would like to do a a ListViewBillable.DataBind() in the Webmethod, calling a postback from JS is not rendering the correct...
0
by: creatiive | last post by:
hi, i have a program that when executed, creates an instance of itself and then runs a method (that has been written in its base class). This works fine, and looks like this; public...
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
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?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.