WCF JSON服务永远不会被击中

时间:2015-04-21 20:44:09

标签: c# json wcf-data-services

我正在尝试使用HTTPS工作的WCF JSON服务,但我不能让它在我的生活中工作。我一直得到400错误我相信它与我的web.config文件有关。这就是我目前所拥有的。

的Web.config

<system.serviceModel>
    <bindings>
      <webHttpBinding>
        <binding name="TransportSecurity" closeTimeout="00:05:00" maxBufferPoolSize="2147483647"
          maxReceivedMessageSize="2147483647">
          <readerQuotas maxDepth="32" maxStringContentLength="5242880"
            maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
          <security mode="Transport">
            <transport clientCredentialType="None" />
          </security>
        </binding>
      </webHttpBinding>
    </bindings>
    <services>
      <service behaviorConfiguration="ServiceBehavior" name="IBVProtoType.PostBack">
        <endpoint address="https://Securesite.com/Webservice.svc"
          binding="webHttpBinding" bindingConfiguration="TransportSecurity"
          contract="IBVProtoType.PostBack"/>
        <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="ServiceBehavior">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
 </system.serviceModel>

Iservice

    [OperationContract]
    [WebInvoke(Method = "POST",
        RequestFormat = WebMessageFormat.Json,
        BodyStyle = WebMessageBodyStyle.WrappedRequest,
        UriTemplate = "PostBack")]
    void PostBack(string data);

0 个答案:

没有答案