WCF REST API POST METHOD可以´;不能从REST CLIENT PHP或Mozilla R


WCF REST API POST METHOD can´t be access from REST CLIENT PHP or Mozilla Rest Client

我使用WCF创建web服务,无法从PHP或MozillaClientRestneneneba API访问POST方法。我试着改变bodyStyle,不声明它,但我做不到。我总是收到一个400坏的请求。GET方法正在工作。这是我的定义:

[OperationContract]
        [WebInvoke(Method = "POST",
            UriTemplate = "/InsertMember",
            RequestFormat = WebMessageFormat.Json,
            ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Wrapped)]
        InsertMemberResponse InsertMember(string city, string address, string state, string zipcode, string country_code, string email, string firtname, string lastname, string password, string national_document_id, string phone, string restaurant_id, string birthday,bool email_checked, bool want_adverts, bool want_notifications, bool want_offers, bool want_thidparty_offers, bool want_newletter, string company_name,string auth );

我的服务模式:

<system.serviceModel>
<services>
  <service name="Mellizos.Fidelidad.Services.RestService">
    <host>
      <baseAddresses>
        <add baseAddress="http://localhost:8733/Design_Time_Addresses/Mellizos.Fidelidad.Services/Service1/" />
      </baseAddresses>
    </host>
    <!-- Service Endpoints -->
    <!-- Unless fully qualified, address is relative to base address supplied above -->
    <endpoint address="" binding="basicHttpBinding" contract="Mellizos.Fidelidad.Services.IRestService">
      <!-- 
          Upon deployment, the following identity element should be removed or replaced to reflect the 
          identity under which the deployed service runs.  If removed, WCF will infer an appropriate identity 
          automatically.
      -->
      <identity>
        <dns value="localhost" />
      </identity>
    </endpoint>
    <!-- Metadata Endpoints -->
    <!-- The Metadata Exchange endpoint is used by the service to describe itself to clients. -->
    <!-- This endpoint does not use a secure binding and should be secured or removed before deployment -->
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service>
</services>
<behaviors>
  <serviceBehaviors>
    <behavior>
      <!-- To avoid disclosing metadata information, 
      set the value below to false 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="False" />
    </behavior>
  </serviceBehaviors>
</behaviors>

我终于在MVC4上换成了Web-Api,没有更多问题了。

最后,我得到了一个理论解释,即在WCF中,有一个要使用的协议的协商,它解决了所有的问题。