Method not allowed 405 when using IIS

I have the following WCF:

    [OperationContract]
    IList<OperationRoomDto> GetOperationRooms();

and I have a website that uses this WCF, when I use Visual studio (Asp.Net development server), it works fine, but when I deploy WCF in IIS, I get this exception:

The remote server returned an error: (405) Method not allowed.

I made a simple website to test this WCF (on IIS) and it worked.

This is part of the web.config file website:

  <endpoint address="http://server/WcfService"
            binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IMessageService"
            contract="MyProject.Web.Wcf.IMessageService" name="BasicHttpBinding_IMessageService">
  </endpoint>

and this part of the web service configuration file:

  <system.serviceModel>
<behaviors>
  <serviceBehaviors>
    <behavior>
      <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
      <serviceMetadata httpGetEnabled="true" />
      <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
      <serviceDebug includeExceptionDetailInFaults="true" />
    </behavior>
  </serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />

I tried to debug the w3wp.exe service to get some hidden exception, I put a breakpoint in the web service methods, but the debugger didn’t even get to it, and this happened before moving on to the web service class.

+5
source share
1

, URL- wcf ,

<endpoint address="http://server/WcfService"

:

<endpoint address="http://server/WcfService/Service.svc"
+11

All Articles