473,795 Members | 2,999 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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("454354545 4....")]
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_End Request(Object sender, EventArgs e)
{
Page page = Context.Handler as Page;
if ((page != null)&&(Busines s.Security.Sess ion.Current != null))
{
Type pageType = page.GetType(). BaseType;

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

Nov 18 '05 #1
2 1331
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.goo glegroups.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("454354545 4....")]
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_End Request(Object sender, EventArgs e)
{
Page page = Context.Handler as Page;
if ((page != null)&&(Busines s.Security.Sess ion.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
1926
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 web service and placed in the references the library class, but when I tried to use the web method, I coudn't pass the dataset of the library class. The web service has changed the reference to the dataset and I have to reference the dataset of the...
3
9523
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 error messages differ depending on when I restart my machine. RIGHT AFTER RESTART: 'WindowsApplication1.exe': Loaded 'oevrvyg9', No symbols loaded. A first chance exception of type 'System.NullReferenceException' occurred in system.dll
5
8271
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 have marked the method(s) with EnableSession=true. I have read everything there is to read! I am told that to reuse session, my client needs to receive a cookie in the header from the webservice and then pass this back in all future calls. ...
7
5406
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 filter-object without setting any properties. but the value type-properties can´t be null and the filter is set to 0 (int) or false (bool). therefore i did implement the propertySpecified-pattern like this:
8
4195
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 this without .config file only with some configuration
5
6914
by: mtv | last post by:
Hi all, I have the following code: ================================ Webservice side: public class MyWS: WebService { private myLib.DataObject curDataObject;
7
2029
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
19600
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 having a problem in the calling program. I searched online and found suggestions that I return an Array instead so I modified my code (below) to return an Array instead of an ArrayList. Now I get the message when I try to run just my webservice...
0
973
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: public class Request {...} public class RequestEntity:Request {...}
0
9673
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9522
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10448
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10217
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9046
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7544
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6784
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5440
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4114
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.