472,803 Members | 1,022 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,803 software developers and data experts.

Redirect all WS & webmethod requests to one webmethod?

Folks,
I've been building a Webservice API for a contract that will be exposed to
the internet at large. There are two endpoints, and each endpoint contains a
number of webmethods. Every webmethod returns a returncode which indicates
the level of success in performing the operation (as well as the actual
results of the call in an "out" parameter)

They have a requirement that when they want to perform maintenance on the
backend system, that they want all webmethods to return a "System not
available" returncode.

Now my initial stab at this was to have each webmethod check some parameter
in the web.config and exit early if it was true, but this is not acceptable,
as they run in a loadbalanced environment, and may have to update many
web.configs.

The mechanism the contract wishes to use (which they already use for their
main website when performing maintenance) is based around adjusting
priorities on their load balancer and redirecting all requests to a "splash"
page ("The system is currently undergoing maintenance, please try again
later"). They want an equivalent for the Webservice API.

So what I have started to do is to create a new webservice project, and add
a httpHandler that redirects every request to a class within the project
(this is how I am forcing requests to either of the endpoints to go to one
class). I'd then like to be able to override something within the WebService
base class that would force all webmethods to be redirected to one webmethod,
which simply returns a "System not available" returncode.

I'd like to do it this redirect way, cos I really don't want to have to
maintain the same WS API in two separate projects (IE every time I add a
webmethod to the main project, that I have to add a stub to the second). I'd
much rather spend more time now getting it right, and not having to look at
it again.

Any ideas what I need to do? Any references? etc etc

Cheers
Pete
Nov 21 '05 #1
2 2764
Hi Peter,

Try adding in a generic Web Service Extension via config file that checks
the web.config file , or some other adminstratively settable flag. In the
case where the "System Not Available", just have the extension intercept
the request and throw a fault (this is probably the right approach - this
is NOT a success case.

This way you could have this simple installable add-in that you configure
into any method you like.

The other alternative is to have them redirect the vroot to a custom HTTP
error and replace the page's HTML output with a SOAP FAULT response.

I hope this helps

Dan Rogers
Microsoft Corporation
--------------------
Thread-Topic: Redirect all WS & webmethod requests to one webmethod?
thread-index: AcTWv9/6HGCBlbI5QpGpuXEIuKg6zQ==
X-WBNR-Posting-Host: 62.17.162.113
From: =?Utf-8?B?UGV0ZXIgTWNFdm95?= <Pe*********@discussions.microsoft.com>
Subject: Redirect all WS & webmethod requests to one webmethod?
Date: Tue, 30 Nov 2004 01:35:05 -0800
Lines: 39
Message-ID: <E9**********************************@microsoft.co m>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFT NGP08.phx.gbl!TK2MSFTNGXA0
3.phx.gbl
Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.webservices:7695
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

Folks,
I've been building a Webservice API for a contract that will be exposed to
the internet at large. There are two endpoints, and each endpoint contains
a
number of webmethods. Every webmethod returns a returncode which indicates
the level of success in performing the operation (as well as the actual
results of the call in an "out" parameter)

They have a requirement that when they want to perform maintenance on the
backend system, that they want all webmethods to return a "System not
available" returncode.

Now my initial stab at this was to have each webmethod check some parameter
in the web.config and exit early if it was true, but this is not
acceptable,
as they run in a loadbalanced environment, and may have to update many
web.configs.

The mechanism the contract wishes to use (which they already use for their
main website when performing maintenance) is based around adjusting
priorities on their load balancer and redirecting all requests to a
"splash"
page ("The system is currently undergoing maintenance, please try again
later"). They want an equivalent for the Webservice API.

So what I have started to do is to create a new webservice project, and add
a httpHandler that redirects every request to a class within the project
(this is how I am forcing requests to either of the endpoints to go to one
class). I'd then like to be able to override something within the
WebService
base class that would force all webmethods to be redirected to one
webmethod,
which simply returns a "System not available" returncode.

I'd like to do it this redirect way, cos I really don't want to have to
maintain the same WS API in two separate projects (IE every time I add a
webmethod to the main project, that I have to add a stub to the second).
I'd
much rather spend more time now getting it right, and not having to look at
it again.

Any ideas what I need to do? Any references? etc etc

Cheers
Pete

Nov 21 '05 #2
THanks again Dan... in this case, I actually went with a slimed-down copy of
each of my asmx files - the methods in this always return the errorcode that
I require. While it's not really generic enough for me to be happy with, it
gets the job done.

I have to disagree with you that I should be throwing a SOAP fault: the
requirement is that we need to stop access to the real APIs while we perform
backend maintenance - so in effect, it is a sucess case, just not a
favourable one for the client app: returning an errorcode which indicates
this fact will prevent third party client apps from crashing, and save alot
of support calls to our customer service people.

Thanks for taking the time to respond tho...

Pete

"Dan Rogers" wrote:
Hi Peter,

Try adding in a generic Web Service Extension via config file that checks
the web.config file , or some other adminstratively settable flag. In the
case where the "System Not Available", just have the extension intercept
the request and throw a fault (this is probably the right approach - this
is NOT a success case.

This way you could have this simple installable add-in that you configure
into any method you like.

The other alternative is to have them redirect the vroot to a custom HTTP
error and replace the page's HTML output with a SOAP FAULT response.

I hope this helps

Dan Rogers
Microsoft Corporation
--------------------
Thread-Topic: Redirect all WS & webmethod requests to one webmethod?
thread-index: AcTWv9/6HGCBlbI5QpGpuXEIuKg6zQ==
X-WBNR-Posting-Host: 62.17.162.113
From: =?Utf-8?B?UGV0ZXIgTWNFdm95?= <Pe*********@discussions.microsoft.com>
Subject: Redirect all WS & webmethod requests to one webmethod?
Date: Tue, 30 Nov 2004 01:35:05 -0800
Lines: 39
Message-ID: <E9**********************************@microsoft.co m>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFT NGP08.phx.gbl!TK2MSFTNGXA0
3.phx.gbl
Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.webservices:7695
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

Folks,
I've been building a Webservice API for a contract that will be exposed to
the internet at large. There are two endpoints, and each endpoint contains
a
number of webmethods. Every webmethod returns a returncode which indicates
the level of success in performing the operation (as well as the actual
results of the call in an "out" parameter)

They have a requirement that when they want to perform maintenance on the
backend system, that they want all webmethods to return a "System not
available" returncode.

Now my initial stab at this was to have each webmethod check some parameter
in the web.config and exit early if it was true, but this is not
acceptable,
as they run in a loadbalanced environment, and may have to update many
web.configs.

The mechanism the contract wishes to use (which they already use for their
main website when performing maintenance) is based around adjusting
priorities on their load balancer and redirecting all requests to a
"splash"
page ("The system is currently undergoing maintenance, please try again
later"). They want an equivalent for the Webservice API.

So what I have started to do is to create a new webservice project, and add
a httpHandler that redirects every request to a class within the project
(this is how I am forcing requests to either of the endpoints to go to one
class). I'd then like to be able to override something within the
WebService
base class that would force all webmethods to be redirected to one
webmethod,
which simply returns a "System not available" returncode.

I'd like to do it this redirect way, cos I really don't want to have to
maintain the same WS API in two separate projects (IE every time I add a
webmethod to the main project, that I have to add a stub to the second).
I'd
much rather spend more time now getting it right, and not having to look at
it again.

Any ideas what I need to do? Any references? etc etc

Cheers
Pete

Nov 23 '05 #3

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

Similar topics

2
by: Robert Gordon | last post by:
I now realize I probably should have tried posting this on the IIS board first.. I am running OWA 2003 Server as Front End server to my Exchange 2000 native domain. The FE server is secured by...
3
by: Raterus | last post by:
Anyone know how I can figure out the figure out the response.redirect trail a browser goes through when I'm using response.redirect on the server. Right now Internet Explorer just automatically...
3
by: Alan Silver | last post by:
Hello, Sorry if this is a stupid question, but I can't really see much difference between these tow methods according to the scant info in the SDK. Could anyone enlighten me? TIA -- Alan...
5
by: deko | last post by:
I'm trying to redirect requests for /index.php to /mydirectory/index.php If I use an index file in / with only this line: <?php header("Location:http://www.mysite.com/mydirectory/"); ?> that...
4
by: mike.biang | last post by:
I have an ASP page that is using an XMLHTTP object to request various pages from my server. I keep a single session throughout the XMLHTTP requests by bassing the ASPSESSIONID cookie through the...
5
by: MikeB | last post by:
Hello All, I need to post / redirect to a 3rd party URL with the form variables dynamically created. Can anyone give me any pointers? TIA
0
by: omer013 | last post by:
Hi; I have an aspx page with a WebMethod to redirect the user to another page. The Default.aspx.cs is; public partial class _Default : System.Web.UI.Page { public static void...
0
by: vinay | last post by:
Hi All, I have a requirement to read a cookie and update its value in a webmethod. This webmethod is located in the code behind of an aspx page(used for partial page udpates). I have added the...
3
by: =?Utf-8?B?UGF0UA==?= | last post by:
We have a site that gets many requests for nonexistent pages, files and folders. We want those requests redirected to the index page. However, for static files (i.e. images and some other...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.