IIS 7.5 Handling 500 Errors Differently Than IIS 6.0 - web-services

Our Classic ASP application contains a web service that can be called over an HTTP. POST or GET. The web service does its duty and then writes out, using Response.Write, an XML message over HTTP.
Here is an example.
Response.ContentType = "text/xml"
Response.Status = "500 Error"
Response.Write("<?xml version=""1.0"" ?>")
Response.Write("<PeelMe>")
Response.Write("<Error>Your orange was actually blue!</Error>")
Response.Write("</PeelMe>")
When the application was hosted in IIS 6.0, the caller received the XML and was able to parse it just fine.
Then, we switched to IIS 7.5.
As in IIS 6.0, we set up a customer error page, let's call it "Blah.asp", to render certain custom text to the browser when an error occurred while an actual user was browsing the site. When we switched to IIS 7.5, all 500 error messages written out to the web service caller were now captured by IIS 7.5, redirecting the thread to Blah.asp and subsequently writing the HTML of Blah.asp back to the caller.
Here is my question:
How do I get IIS 7.5 to act like IIS 6.0 so that when I want to write out a 500 Error message back to a web service caller, I can do that, without IIS 7.5's custom error handling getting in the way?

Since IIS7 the web.config offers more options. You could try the following to get the bevaviour you are after:
<system.webServer>
<httpErrors errorMode="Detailed">
<remove statusCode="500" subStatusCode="-1" />
<error statusCode="500" prefixLanguageFilePath="" path="/[CUSTOMERRORPAGE].asp" responseMode="ExecuteURL" />
</httpErrors>
</system.webServer>

Did you try setting the app pool to asp classic? We've been doing a lot of upgrades lately; constantly running into issues with 7.5.
Setting the app pool back, resolves probably 80% of our issues.

Related

Tomcat application routed trough IIS URL Rewrite cannot reach subdirectory (Error code 500)

This is my first time using IIS and it has become a big headache. The objective is to run a web application trough an IIS on a windows 2012 server. The application is hosted on tomcat 8.5.
The application runs perfectly on 'localhost:8000/application', but then an issue occur when trying to do the URL rewrite to 'application.domain.com'.
The URL correctly accesses the needed javascript files and styles the page correctly, but error code 500() is returned on a call to 'application.domain.com/subdirectory'. Unfortunately error 500 just implies some server error has occurred. The subdirectory is used to get data to the application and contain HTTP GET and HTTP POST methods.
My current implementation of the IIS:
I crated a new site 'application'. This site has an inbound and an outbound URL Rewrite reverse proxy rule.
I am suspecting that there could be issues with the RegEx pattern, but i am not sure.
I am aware that there are some implications routing tomcat trough IIS and i have attempted to solve that with Application Request Routing(ARR), but without luck. I set up the ARR with a tomcat server farm according to this guide but ended up with error 502.2 - "Bad Gateway" instead.
This is the first time i have to mess with these things, so it's likely I got it all wrong and there is a much simpler solution. Thanks in advance.

Webservice .Net 4.0 publishing problems in IIS7

I cant get my Webservice published, it should be simple:
I create the app in the IIS,
place it as a 4.0 Classic .Net
I publish it from .Net Solution within VS2012 Right click and publish
on the Webservice project.
The files are placed and it should show by itself on the browser on the URL of the server specified.
But I stumbled upon the following problems:
HTTP Error 404.17 - Not Found
The requested content appears to be script and will not be served by the static file handler.
So I've looked for It and found this two options:
Option 1:
http://www.banmanpro.com/support2/Requested_Content_Appears_to_be_Script.asp
This one says I should go to Integrated, instead of Classic App Pool. but it's like if I changed a problem for another because now it says:
HTTP Error 500.21 - Internal Server Error
Handler "WebServiceHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in its module list
When I go to the web config see what is this error talking about I see no handler tag!
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appSettings />
<connectionStrings />
<system.web>
<compilation targetFramework="4.0" />
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows" />
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm"/>
<error statusCode="404" redirect="FileNotFound.htm"/>
</customErrors>
-->
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID" />
</system.web>
<system.webServer>
<directoryBrowse enabled="true" />
</system.webServer>
<!--
The system.webServer section is required for running ASP.NET AJAX under Internet
Information Services 7.0. It is not necessary for previous version of IIS.
-->
</configuration>
Should I add one? If so, how?
Option 2:
Script not served by static file handler on IIS7.5
Basically it says I shoud do a aspnet_regiis -i, but when I try
going to %windir%\Microsoft.NET\Framework\v4.0.30319
Even when the folder exists, There is no aspnet_regiis!!
I've only found the aspnet_regiis on the 2.0 Fwk =(
Is that normal?
The handler tag wasn't the answer, however, both options drove me to look for the missing aspnet_regiis of fwk 4.
There was no aspnet_regiis because the full fwk 4.0 wasn't actually installed on a first place.
I had installed on the server the Framework 4 Client Profile and the debugger, which isn't the full version. From now on, whenever I think I have fwk 4 installed, I'll check twice.
After installing it, on Framework 4.0 Classic Pipeline Mode (instead of Integrated) made it work just fine.
But Attention!
After installing the framework, IIS will change the default pipeline to 4.0, that means, if you had ongoing a web(site/service) on 2.0 it will automatically stop working. (It happened to me)

The HTTP request is unauthorized with client authentication scheme 'Ntlm'. The authentication header received from the server was 'NTLM'

I am trying to program a VisualWebPart using Visual Studio 2010 which has to do a simple thing: invoke a web service (hosted in a remote server, NOT locally). When I execute within the Sharepoint site (version 2010, which I have published in my IIS) I get this error:
"The HTTP request is unauthorized with client authentication scheme 'Ntlm'. The authentication header received from the server was 'NTLM'."
Pardon my ignorance, but the only difference here is the case of the Ntlm authentication scheme! I have been all over the web and found many related problems, but none of the solutions worked. Almost ALL solutions i found involve modifications in the webservice security configuration, this is not an option for me.
Looking for a solution, I created a sample windows form and invoked the web service from it: no problems whatsoever.
In order to be able to invoke the webservice correctly this is the necessary security configuration:
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Ntlm" proxyCredentialType="Ntlm" realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
I believe the problem is that I havenĀ“t been able to properly set this security property to the web.config of my Sharepoint site, since I tried to put it in the security tag that appears in the web.config but still get the same error.
Any further information needed please ask, I am REALLY desperate, for days I have been with the SAME error.
In the end I was given permissions in their server: more precisely in the database which was the one that wouldn't let me create the web part in the server. Once this was done, the call to the webservice worked just fine, because they have the web.config correctly configured.

GlassFish Server (open source) ColdFusion "requested resource is not available" error

We are in the process of moving a website coded in ColdFusion and Fusebox framework to a new host (from GoDaddy who is ceasing to support CF to HostMySite).
Our url structure is currently setup like /index.cfm/home.register redirecting through a cfscript to the "full" url of /index.cfm?fuseaction=home.register
We are receiving the following error message:
HTTP Status 404 -
type Status report
message
descriptionThe requested resource () is not available.
GlassFish Server Open Source Edition 3.1
I am not a CF or Windows guy, this is an old site and we are just trying to get it to run on another server to bide us some time until we can rewrite it.
Any clue as to how to what is wrong and how to get it to work? HostMySite support has been completely unresponsive thus far.
Any help would be greatly appreciated!
Brandon, just for the sake of correctness; Glassfish is Oracle's java server and comes in an open source flavour. http://glassfish.java.net/
Glassfish is not a ColdFusion server.
It is possible to deploy j2ee versions of Adobe ColdFusion, Railo or OpenBD using glassfish.
JRun is the only Java server that comes with the SES rewriting built in. However, it is possible to rewrite urls using most Java servers or at the least by fronting the java server with a web server such as IIS, Apache or nginx.
After several discussion with tech support, we confirmed that "GlassFish Server" is an open source ColdFusion server, and it does not support the search engine friendly URL code we were using. We had to switch hosts to a host that used actual CF server.

Compact Framework - Invalid URI: Hostname could not be parsed

I'm writing a compact framework 3.5 application for a windows mobile device. In this application I'm consuming a web service in order to sync with our database. However, whenever I try to make a call to the web service from the device or the emulator, I get the following error: Invalid URI: Hostname could not be parsed. I'm connected to the network via R-NDIS. The service is running on my development machine right now, and I'm actually able to browse to the asmx page through pocket IE. What am I missing?
Thanks!
This might be a proxy problem. The following worked for me.
var service = new WebService.Service();
service.Proxy = GlobalProxySelection.GetEmptyWebProxy();
You might not be picking up the proxy server IE is using, or pocket IE might be displaying a cached version of the ASMX page (and thus not really able to access it either). Probably neither one of these is your problem, however.
Update: try putting this in your application's config file:
<configuration>
<system.net>
<defaultProxy>
<proxy autoDetect="true" />
</defaultProxy>
</system.net>
</configuration>