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

Determine which WebService class serves the request

I need determine which web service (class WebService or its inheritors)
serveces current request (I need Type instance of class that serves
request).

For example you wrote your own WebService:

[Guid("4543545454....")]
public class MyService : WebService ....

Now I need to know the Guid of WebService class that serves current
request

I solved simultinous problem for Page, but for WebService it looks more
difficult.

Thanx for help.

Here is solution with Page:
in Global.asax.cs

protected void Application_EndRequest(Object sender, EventArgs e)
{
Page page = Context.Handler as Page;
if ((page != null)&&(Business.Security.Session.Current != null))
{
Type pageType = page.GetType().BaseType;

// I have information about class (Page) servicing request
Guid guid = pageType.Guid;
}
}

Nov 18 '05 #1
2 1300
why does the approach not work for

WebService svc = Context.Handler as WebService ;

??
-Dino

"Sergi Adamchuk" <ad******@gmail.com> wrote in message
news:11**********************@c13g2000cwb.googlegr oups.com...
I need determine which web service (class WebService or its inheritors)
serveces current request (I need Type instance of class that serves
request).

For example you wrote your own WebService:

[Guid("4543545454....")]
public class MyService : WebService ....

Now I need to know the Guid of WebService class that serves current
request

I solved simultinous problem for Page, but for WebService it looks more
difficult.

Thanx for help.

Here is solution with Page:
in Global.asax.cs

protected void Application_EndRequest(Object sender, EventArgs e)
{
Page page = Context.Handler as Page;
if ((page != null)&&(Business.Security.Session.Current != null))
{
Type pageType = page.GetType().BaseType;

// I have information about class (Page) servicing request
Guid guid = pageType.Guid;
}
}

Nov 18 '05 #2
For WebPage it does work good but for WebService it does not work for
me.

Nov 18 '05 #3

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

Similar topics

2
by: Zürcher See | last post by:
I have to write a program to pass data through a web service, Ill use two strongly typed dataset enbedded in a library class, a "request" and an "answer" dataset. I've wrote the program and the...
3
by: subha | last post by:
I have a HelloWorld webservice that works on my IE browser. But, when I add a webreference to it and call the HelloWorld method from my WindowsFormsApp (return in C#), I get error messages. The...
5
by: jb | last post by:
*Please* help --- I'm tearing my hair out. I want to use sessionstate in a webservice, accessed from a client, written in script (JScript, InfoPath). I have written my webservice (C# .NET). I...
7
by: stephan querengaesser | last post by:
hi ng, i try to invoke a webservice-method with an filter-object, that contains value types. if i don´t want to filter the return value of the method, i have to pass a new instance of the...
8
by: Topper | last post by:
Hello. I have simple web folders structure: -ROOT - BIN WebService.dll WebService.asmx I need to use my WebService.dll not in bin folder - for example, in ROOT. How do i this? How can i do...
5
by: mtv | last post by:
Hi all, I have the following code: ================================ Webservice side: public class MyWS: WebService { private myLib.DataObject curDataObject;
7
by: Alessandro Benedetti | last post by:
Hi. I'm calling two methods of a .NET Webservice (A) from another Webservice (B). The A Webservice is made like this: public class WSA: System.Web.Services.WebService { private int X = 0;
5
by: Stacey Levine | last post by:
I have a webservice that I wanted to return an ArrayList..Well the service compiles and runs when I have the output defined as ArrayList, but the WSDL defines the output as an Object so I was...
0
by: werbung | last post by:
Hi everyone, I have a class called Request and a whole bunch of inherited classes, for example RequestEntity. And I have a WebMethod Execute which takes the Request class as an argument: ...
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: 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
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:
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.