The remote server returned an unexpected response: (405) Method Not Allowed. RRS feed

  • Question

  • Hi ,

    I have created WCF application and hosted in the remote server IIS as https.

    I have added this service as reference in windows application and able select the view the methods inside the service.

    Problem is when i access the methods in the windows application I get the error as follows,

    "The remote server returned an unexpected response: (405) Method Not Allowed."

    Please guide me on this ASAP.

    Monday, October 6, 2014 4:07 PM

All replies

  • Hi M.shan,

    For this situation, about the error message, which may indicate that it occurs if ASP.NET is not installed or the .svc file type is not mapped to the aspnet_isapi.dll.

    To correct this you must make sure that aspnet_isapi is enabled as a Web service extension for IIS. You can view and modify this setting using IIS Manager, or by running aspnet_regiis –i –enable from the .NET Framework installation directory. Once you have done so, verify that ASP.NET is running. To do so, place a test .aspx file in the \inetpub\wwwroot directory, and make sure it can be browsed with a browser.

    For more detailed information, you could refer to:


    • Marked as answer by M.shan Tuesday, October 7, 2014 10:07 AM
    • Unmarked as answer by M.shan Tuesday, October 7, 2014 10:08 AM
    Tuesday, October 7, 2014 5:43 AM
  • Hi ,

    Thanks for your reply

    I checked with all the options which you have given, but I get the same error "The remote server returned an unexpected response: (405) Method Not Allowed."

    I have added Managed Handler & Script Map in the IIS and installed the HTTP activation, but the result is same.

    Also I executed following step,

    1.register ASP.NET runtime from VS.NET 2005/2008 command line run: aspnet_regiis –i –enable

    2. map *.svc file by
    2.1 Win2003 or XP run: "%WINDIR%\Microsoft.Net\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe" -r
    2.2 Win2008 or Vista run: "%WINDIR%\Microsoft.Net\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe" -L
    3. then restart your IIS  iisreset /noforce

    After these steps I got following error message,

    "Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly"

    For this issue I applied the steps as per this link,

    After applying these steps, I again got the "The remote server returned an unexpected response: (405) Method Not Allowed" again.

    I have been checking this issue for more number of days. Resolved suggestion will be great.

    Please guide me on this ASAP. Thanks in advance.

    • Edited by M.shan Tuesday, October 7, 2014 10:07 AM
    Tuesday, October 7, 2014 10:04 AM
  • Hi ,

    Please help me on the above query ASAP. Awaiting for reply.

    Thursday, October 9, 2014 4:56 AM
  • Hi,

    There might be many reasons for this error, and for the current circumstance, you could get more information from the following links:

    And about host the service in IIS:

    Besides, you could post the corresponding server config file here so that we could make a further research.


    Thursday, October 9, 2014 6:00 AM
  • Hi ,

    I have checked with the above 3 links and applied the solution but still same error getting as "The remote server returned an unexpected response: (405) Method Not Allowed".

    I have attached my web config code block below,

    <?xml version="1.0" encoding="UTF-8"?>
            <compilation debug="true" strict="false" explicit="true" targetFramework="4.0" />
    	<customErrors mode="Off" />
            <binding name="TransportSecurity" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text">
              <security mode="Transport">
                <message clientCredentialType="Certificate" />
                <transport clientCredentialType="None" />
          <!-- This section is optional with the default configuration introduced
             in .NET Framework 4. -->
          <service name="InStoreService.LicenseCheck">
            <endpoint address="Service URL" binding="wsHttpBinding" bindingConfiguration="TransportSecurity" contract="InStoreService.IService_DB">
    	   <dns value="DOmain name" />
            <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
    	<useRequestHeadersForMetadataAddress />
              <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
              <serviceMetadata httpsGetEnabled="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="false" />
        <serviceHostingEnvironment multipleSiteBindingsEnabled="false"  />
          <standardEndpoint name="" crossDomainScriptAccessEnabled="true"/>
        <modules runAllManagedModulesForAllRequests="true" />
            <directoryBrowse enabled="true" />
                <remove name="svc-Integrated" />
                <add name="svc-Integrated" path="*.svc" verb="GET,HEAD,POST,DEBUG,PUT,DELETE" type="System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode,runtimeVersionv2.0" />
    Please let me know if I have made any mistakes in the above config details .

    Awaiting for your reply ASAP. Thanks in advance.

    FYI, I am using HTTPS binding.

    Monday, October 13, 2014 7:23 AM
  • Hi ,

    Please review above web config file ASAP and let me know any issues with config file.

    Awaiting for reply.

    Wednesday, October 15, 2014 9:33 AM