First of... Thanks for all the responses.

Unfortunately none of them seems to cover all bases.

Let me explain:  I'm trying to create a generic static method that can
answer this simple question but... I would like to be able to invoke it
under multiple contextes.   Not only inside the page or webservice code but
also under the HttpModule's and SoapExtension chains (client or server
side).  And there lies the problem!

1)HttpContext.Current.Handler
This is null in some circumstances.  For example during the HttpModule and
SoapExtension execution chain.

2)HttpContext.Current.Request.ContentType == "text/xml"
I was using this before.  Well close!  The ContenType is not == "text/xml"
but rather contains "text/xml".   Problem is: when invoking a webservice
through the DefaultWsdlHelpGenerator.aspx page, the ContextType does not
contain the "text/xml" substring.

3)Parsing raw URL
This is *exactly* what I'm truing to avoid ;-)  If I can of course!

Along the lines of parsing the URL, I have tried:

1)Checking whether HttpRequest.Url.LocalPath.EndsWith( "ASMX" ) and
2)Looking for the HTTP_SOAPACTION ServerVariable

but both get defeated when the webservice is called from the standard
webservice test page.

Any other suggestions?
MP

===================================
This list is hosted by DevelopMentor�  http://www.develop.com
Some .NET courses you may be interested in:

NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles
http://www.develop.com/courses/gaspdotnetls

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to