0

当托管在我们的 IIS 服务器上但将其移动到客户端的服务器之后,我可以在通过浏览器调用方法时看到 JSON 数据。虽然我只能通过 WCF 测试客户端看到,但我看不到来自浏览器的数据......在哪里我错了..你能建议应该做什么。

 <bindings>
        <wsHttpBinding>
            <binding name="LargeSettings" maxBufferPoolSize="524288"    maxReceivedMessageSize="6553600">
                <readerQuotas maxDepth="32" maxStringContentLength="100000" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
                <security mode="None"/>
            </binding>
        </wsHttpBinding>
    </bindings>

    <behaviors>
        <serviceBehaviors>
            <behavior name="mobserviceBehavior">
                <serviceMetadata httpGetEnabled="true"/>
                <serviceDebug includeExceptionDetailInFaults="true"/>

            </behavior>
        </serviceBehaviors>
        <endpointBehaviors>
            <behavior name="WebBehavior">
                <webHttp/>
            </behavior>
        </endpointBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
    <services>
        <service name="clubconnect.mobservice" behaviorConfiguration="mobserviceBehavior">
            <endpoint address="" binding="wsHttpBinding" contract="clubconnect.imobservice" bindingConfiguration="LargeSettings"/>
            <endpoint address="ws" binding="webHttpBinding" contract="clubconnect.imobservice" behaviorConfiguration="WebBehavior">
                <identity>
                    <dns value="http://domain"/>
                </identity>
            </endpoint>
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
        </service>
    </services>
4

1 回答 1

0

您需要在其中添加一个基地址

        <host>
          <baseAddresses>
            <add baseAddress="http://<URL to the .svc file>" />
          </baseAddresses>
        </host>

然后您的 webHttpBinding 端点“ws”的相对地址将解析为

http://<URL to the .svc file>/ws
于 2014-12-30T09:32:43.377 回答