1

Previously a MVC 4 application was hosted in windows 2003 server asp.net 4.0.30319 and the WCF Service was hosted there as well.
Anonymous access was checked along with IUSR_ account and the checkbox for Integrated Windows Authentication.

Now Upon moving the Website and Service both to Windows 2012 Server ( IIS 8 ) Hitting the Webservice works fine:

http://exampleservicetest.test.com/Service.svc?wsdl

Problem: Pulling up the website which calls the service returns a 405 error put below. Tampering with settings per google is not fixing the issue....

Error.

An error occurred while processing your request.
ProtocolException
    System.ServiceModel.ProtocolException: The remote server returned an unexpected      response: (405) Method Not Allowed. ---> System.Net.WebException: The remote server    returned an error: (405) Method Not Allowed.
at System.Net.HttpWebRequest.GetResponse()
at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
--- End of inner exception stack trace ---
Tom Stickel
  • 19,633
  • 6
  • 111
  • 113
  • have you checked the application pool .net framework? – Vland Jan 07 '14 at 23:49
  • Both the web app and service are running there own application pool , both are Integrated Pipeline and v4.0 – Tom Stickel Jan 07 '14 at 23:52
  • If the sites on on the same IIS server, with latest version of IIS is it possible it needs a crossdomainpolicy in the web.config ? http://stackoverflow.com/questions/5686059/how-to-avoid-cross-domain-policy-in-jquery-ajax-for-consuming-wcf-service – Tom Stickel Jan 07 '14 at 23:57

2 Answers2

0

It looks like it is a common configuration issue. This is an HTTP Transport status error which normally means that you tried to make an Http Request using an HTTP method that is not supported by the web server. That said, you need to have a look at how your website is requesting this service, what http method it is using...GET, POST, PUT, DELETE, HEAD,etc. and determine whether your web server supports this method.

Common causes are:

  1. The web method that the service exposes doesn't support this Http Method. This is not your case
  2. Your has WebDav Publishing installed and it is enabled for your website
    • If you need WebDav then check your settings to enable the required permissions as described in this Blog Post (noticed that it's related to IIS7.5 but you can find some documentations about how to do the same in IIS8 in the IIS Website)
    • If you disable WebDav you might need to also disable the related module and handler in your web.config file
  3. If you are using extensionless REST urls and you are using PUT and DELETE methods then you might need to configure the applicationhost.config file to support these http methods by modifying the verb property of the Extensionless-Url handler element.

    <add name="ExtensionlessUrl-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />

Leo
  • 14,625
  • 2
  • 37
  • 55
  • This stuff already worked on a 2003 server, not using REST, not using WebDav. This is simply a permissions issue specific to one IIS website talking to another on same IIS server one being the WCF web service of which CAN be displayed on the server in URL AND from my workstation, but the website that normally talks to this WCF service is somehow not currently able to – Tom Stickel Jan 13 '14 at 20:19
  • Ok, that's exactly why I suggested it was a configuration issue. But, if you want to get more accurate responses it'd be good if you update your answer to show how your service is configured and how the website is accessing your web service – Leo Jan 14 '14 at 00:42
0

It was the web.config not having the full service.svc in the path....

Tom Stickel
  • 19,633
  • 6
  • 111
  • 113
  • 2
    Maras: This answer is _by_ the author of the question. You might want to review your review... – cfi Jan 14 '14 at 08:26
  • Still, if author or someone can explain what this means that'd be great, sincerely, everyone finding this question foreverafter... – MGOwen Oct 20 '14 at 03:05
  • I don't have access to that code. But it was a messed up url for the service in the web.config – Tom Stickel Oct 20 '14 at 03:38