none
Error "Method Not Allowed" while testing WCF RESTFUL service using WCF Test Client RRS feed

  • Question

  • Hi,
    I am getting below error:
    "Method Not Allowed.HTTP GET Error    URI: http://localhost:59570/BankInstitutionService.svc    There was an error downloading 'http://localhost:59570/BankInstitutionService.svc'"

    My service endpoint details:

     <system.serviceModel>
        <services>      
          <service behaviorConfiguration="InvestmentManagerWCF.BankInstitutionServiceBehavior"
            name="InvestmentManagerWCF.BankInstitutionService">
            <endpoint address="" binding="webHttpBinding" contract="InvestmentManagerWCF.IBankInstitutionService">
              <identity>
                <dns value="localhost" />
              </identity>
            </endpoint>
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
          </service>
        </services>
        <behaviors>
          <serviceBehaviors>
            <behavior name="InvestmentManagerWCF.BankInstitutionServiceBehavior">
              <serviceMetadata httpGetEnabled="true" />
              <serviceDebug includeExceptionDetailInFaults="false" />
            </behavior>
          </serviceBehaviors>
        </behaviors>
      </system.serviceModel>

    Please let me know if you have thoughts.

    Cheers,
    Abhilash

    Sunday, April 28, 2013 1:06 PM

Answers

All replies

  • Hi..

    Possible reason.. you might be having only POST methods in Service Contracts. Verify.

    Thanks,

    Kishore.

    Sunday, April 28, 2013 1:21 PM
  • No. I am having below methods:

    [OperationContract]
    [WebInvoke(Method="Get",UriTemplate = "bank/{bankId}")]    
    BankInstitution GetBankInstituion(int bankId);        
    
    [OperationContract]        
    [WebInvoke(Method = "Post",UriTemplate = "banks}")]        
    bool SaveBankInstituion(BankInstitution BankInstitution);


    Sunday, April 28, 2013 1:28 PM
  • Hi,

    Some features are not supported by WCF Test Client, for WebHttpbinding, Json response message support but not for Xml. Please check if this is the issue.

    The following is a list of features not supported by WCF Test Client:

    • Types: Stream, Message, XmlElement, XmlAttribute, XmlNode, types that implement the IXmlSerializable interface, including the related XmlSchemaProviderAttribute attribute, and the XDocument and XElement types and the ADO.NET DataTable type.
    • Duplex contract.
    • Transaction.
    • Security: CardSpace , Certificate, and Username/Password.
    • Bindings: WSFederationbinding, any Context bindings and Https binding, WebHttpbinding (Json response message support).

    http://msdn.microsoft.com/en-us/library/bb552364.aspx

    Best Regards.


    Haixia
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, April 29, 2013 9:28 AM
    Moderator
  • Following below step by step approach worked:

    http://www.codeproject.com/Articles/105273/Create-RESTful-WCF-Service-API-Step-By-Step-Guide

    Cheers,
    Abhilash

    • Marked as answer by AbhilashShah Wednesday, May 1, 2013 3:10 AM
    Wednesday, May 1, 2013 3:10 AM