本文介绍了405将MVC 4应用程序和WCF服务移至IIS 8时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以前,MVC 4应用程序托管在Windows 2003服务器asp.net 4.0.30319中并且WCF服务也托管在这里.
已检查匿名访问以及IUSR_帐户以及集成Windows身份验证"复选框.

现在将网站和服务都移动到Windows 2012 Server(IIS 8)后击打Webservice可以正常工作:

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

问题:拉起调用该服务的网站会返回下面的405错误.篡改每个Google的设置并不能解决问题.

错误.

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 ---

Previously a MVC 4 application was hosted in windows 2003 server asp.net 4.0.30319and the WCF Service was hosted there as well.
Anonymous access was checked along with IUSR_ accountand 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 ---
解决方案

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

这篇关于405将MVC 4应用程序和WCF服务移至IIS 8时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 16:19