Using GWT getting 405 error message on IIS 7.5 - ajax

I have inherited a project that is using GWT to post login information via a form. According to Firebug, its coming back with a 405 error.
I have tried the directions on: IIS 7.5, Web Service and HTTP 405 error
That didn't fix the problem. I turned on Failed Request tracking and this is the error that I see:
MODULE_SET_RESPONSE_ERROR_STATUS
Warning
ModuleName="StaticFileModule", Notification="EXECUTE_REQUEST_HANDLER", HttpStatus="405", HttpReason="Method Not Allowed", HttpSubStatus="0", ErrorCode="Incorrect function.
(0x80070001)", ConfigExceptionInfo=""
Thanks!

Related

ASP.NET Core MVC : catch 503 error and redirect to view

In my ASP.NET Core MVC application, I'm trying to catch and isolate 503 error which is coming from the API project, we are intentionally stopping the app pool for the API in order to get the error and instead of this screen:
I want to redirect to a specific view, for example /Home/Error, is there an option to do that in the configuration of the ASP.NET Core MVC project?
Your application running in (or being accessed through) the ASP.NET Core Module is the service that is reported to be unavailable by this error page.
The 503 is returned by IIS, not by your application. The whole reason the 503 is returned, is because your application doesn't respond to IIS, so even if you wanted to, you can't return it from your application.
See Custom Error Page for Http Error 503 to change the IIS 503 error page.

ASP.NET Unauthorized in Postman using IIS Express, but works in Chrome

I am trying to test an ASP.NET Web Api locally using IIS Express. When I use Chrome and hit the url (localhost:5000/api/test, for example) the json displays fine, but when using Postman I keep getting unauthorized 401.2 when hitting the same url. The api controller has Anonymous access on the route.
On the error message, one of the likely causes is:
Integrated authentication is enabled and the request was sent through a proxy that changed the authentication headers before they reach the Web server.
Is Postman somehow changing the headers?
[2019 Update]
Got the same issue, I couldn't debug an ASP Core 2.1 API using Postman when running on the local machine using IIS Express. I kept on having "Could not get any response" despite it was working fine on a browser.
Following troubleshooting steps explained here PostmanLabs Github, I noticed into Postman console that this was coming from a certificate issue.
Disabling SSL Verification from Postman Settings > General allowed the request to pass through.
Looks like it's your proxy.
I haven't found the proxy setting in postman. So I deleted postman for Win and installed postman for Chrome. Possibly Postman gets the environment from Chrome.
Anyway the resolution is to use Postman for Chrome instead of Postman for Win.
I have a localhost WebAPI site up with IIS Express (HTTPS). Postman started to respond as expected to GETs and POSTs after I changed (in Postman)
File --> Settings --> Proxy
to: "Use the system proxy"
and turning on: "Respect HTTP_PROXY ...".
I had earlier set up a custom proxy that wasn't working with HTTPS.

Cross-Origin Request Blocked error while Requesting WebAPI services

I am working on a OJET framework project on NetBeans. And I am making a call to .Net WebAPI service through Ajax. The request is reaching the server fine and it is getting processed fine, anyhow while receiving the data I can the below error in browser console.
"Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource"
I know I am working on cross platforms but not sure how to resolve this issue.
Can anyone help me on this?
Thanks in advance.

WebAPI call working in Postman, returning 404 error on website

I am having an odd issue. When I call my webapi service from Postman, it works:
but when I call it from within my browser (or from within the app), it returns a 404 error:
Anyone have any idea what might be happening here?

How to Mimic Server Down(503) With Windows 8 Phone Emulator, IIS Express, Web Api?

Does anyone know how to get a 503 error to occur when doing a call from code in a windows phone application.
I tried by not running my web api project and just loading up and doing a call to that project but it just comes back 403 and not 503.
You can throw the 503 error with this line of code in your WebAPI controller:
throw new HttpResponseException(Request.CreateErrorResponse(HttpStatusCode.ServiceUnavailable, "Service unavailable");

Resources