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 2 2839
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/6HGCBlbI5QpGpuX EIuKg6zQ==
X-WBNR-Posting-Host: 62.17.162.113
From: =?Utf-8?B?UGV0ZXIgTWN Fdm95?= <Pe*********@di scussions.micro soft.com>
Subject: Redirect all WS & webmethod requests to one webmethod?
Date: Tue, 30 Nov 2004 01:35:05 -0800
Lines: 39
Message-ID: <E9************ *************** *******@microso ft.com>
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.publi c.dotnet.framew ork.webservices
NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.1.29
Path:
cpmsftngxa10.ph x.gbl!TK2MSFTFE ED01.phx.gbl!TK 2MSFTNGP08.phx. gbl!TK2MSFTNGXA 0
3.phx.gbl
Xref: cpmsftngxa10.ph x.gbl
microsoft.publi c.dotnet.framew ork.webservices :7695
X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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
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/6HGCBlbI5QpGpuX EIuKg6zQ== X-WBNR-Posting-Host: 62.17.162.113 From: =?Utf-8?B?UGV0ZXIgTWN Fdm95?= <Pe*********@di scussions.micro soft.com> Subject: Redirect all WS & webmethod requests to one webmethod? Date: Tue, 30 Nov 2004 01:35:05 -0800 Lines: 39 Message-ID: <E9************ *************** *******@microso ft.com> 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.publi c.dotnet.framew ork.webservices NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.1.29 Path: cpmsftngxa10.ph x.gbl!TK2MSFTFE ED01.phx.gbl!TK 2MSFTNGP08.phx. gbl!TK2MSFTNGXA 0 3.phx.gbl Xref: cpmsftngxa10.ph x.gbl microsoft.publi c.dotnet.framew ork.webservices :7695 X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 a 128 bit SSL cert. The OWA 2003
server is running on Windows 2003 server in a Windows 2003 native AD domain.
At present, the server is configured so that user's have to specifically go
to the URL httpS://myserver.company.com in order to access...
|
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 redirects, I need to figure out, on the client, the pages it is being told to go to. Yes I know I can look in the address bar, but say the Response object is redirecting 3 or 4 pages per Request. I need this for a debugging issue.
Thanks
--Michael
|
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 Silver
|
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 seems to work.
But can this be accomplished more efficiently with an htaccess rewrite?
|
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 XMLHTTP object.
However, when the page requested through the XML object makes a
<%Response.Redirect()%>
call, a new session is created each time.
Is this a flaw in the XMLHTTP Object? How can I force the session to
remain the same after a...
| |
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
|
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 redirect_user()
{
HttpContext.Current.Response.Redirect("home.aspx");
}
|
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 attribute EnableSession =
true().
I am able to access and edit the cookie through
HttpContext.Current.Request.Cookies. But in subsequent requests,
changes are lost out. i.e, i can't find the changes i made.
Any help is appreciated.
|
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 extensions) we do not want to
redirect and in that case want to return nothing.
We had been using the 404 error page to redirect but need to discriminate
the type of file being requested so that we do not return a page when an
image is required.
We'd...
|
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...
|
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,...
| |
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...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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...
|
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();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |