WCF中的多个EndPoint:Json和Soap

时间:2014-04-14 15:09:29

标签: json web-services wcf soap wcf-binding

我正在尝试配置我的WCF服务以支持多个端点(json和soap),但json end无效。这是我的web.config。如果您可以帮我修改配置或向我展示任何可下载的工作样本,我将非常感激。

<system.serviceModel>
<behaviors>
  <endpointBehaviors>
    <behavior name="jsonBehavior">
      <webHttp/>
    </behavior>
  </endpointBehaviors>
  <serviceBehaviors>
    <behavior>
      <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
      <serviceDebug includeExceptionDetailInFaults="false"/>
    </behavior>
  </serviceBehaviors>
</behaviors>
<bindings>
  <basicHttpBinding>
    <binding
      name="config_BasicHttpBinding"
      maxBufferSize="1000000"
      maxReceivedMessageSize="1000000">
      <readerQuotas
        maxBytesPerRead="1000000"
        maxArrayLength="1000000"
        maxDepth="1024"
        maxStringContentLength="1000000"/>
    </binding>
  </basicHttpBinding>
  <webHttpBinding>
    <binding
       name="config_WebHttpBinding"
       maxBufferSize="1000000"
       maxReceivedMessageSize="1000000">
      <readerQuotas
        maxBytesPerRead="1000000"
        maxArrayLength="1000000"
        maxDepth="1024"
        maxStringContentLength="1000000"/>
    </binding>
  </webHttpBinding>
</bindings>
<protocolMapping>
    <add binding="basicHttpsBinding" scheme="https" />
</protocolMapping>
<services>
  <service name="LA.API.LAService">
    <endpoint address="json" behaviorConfiguration="jsonBehavior"
      binding="webHttpBinding" bindingConfiguration="config_WebHttpBinding"
      contract="LA.API.ILAService" />
    <endpoint address="soap" binding="basicHttpBinding" bindingConfiguration="config_BasicHttpBinding"
       contract="LA.API.ILAService" />

  </service>
</services>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />

0 个答案:

没有答案