2011-06-15 134 views
0

我想测试一个使用WCF Web服务的MVC应用程序。当我在VS2010中使用dev服务器运行它时,它工作正常。然而,当我在IIS7上部署和尝试调用在我的控制器代码中,我碰到下面的错误任何服务方法: (405)不允许的方法(405)方法不允许。 MVC应用程序使用WCF服务

有谁知道如何解决这个问题?

我的web配置项如下:

<system.serviceModel> 
    <bindings> 
     <basicHttpBinding> 
     <binding name="BasicHttpBinding_IAuthenticationService" closeTimeout="00:01:00" 
      openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" 
      allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" 
      maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" 
      messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" 
      useDefaultWebProxy="true"> 
      <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" 
      maxBytesPerRead="4096" maxNameTableCharCount="16384" /> 
      <security mode="None"> 
      <transport clientCredentialType="None" proxyCredentialType="None" 
       realm="" /> 
      <message clientCredentialType="UserName" algorithmSuite="Default" /> 
      </security> 
     </binding> 
     </basicHttpBinding> 
    </bindings> 
    <client> 
     <endpoint address="http://SiteName/ServiceName/AuthenticationService.svc" 
     binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IAuthenticationService" 
     contract="AuthService.IAuthenticationService" name="BasicHttpBinding_IAuthenticationService"> 
     </endpoint> 
    </client> 
    </system.serviceModel> 
+0

你正在部署 - mvc应用程序,wcf,还是两者? – 2011-06-15 05:47:23

+0

在同一台机器上部署两者。 – kartikq 2011-06-15 15:06:37

回答

0

Duh ... WCF服务和MVC应用程序与.NET版本不匹配! :(傻我

0

听起来像老“ASP.NET未安装或未注册到IIS” problemo尝试注册它使用

aspnet_regiis –i –enable 

从命令提示在管理员权限下运行。