簡體   English   中英

WCF REST webHttpBinding-404錯誤

[英]WCF REST webHttpBinding - 404 Error

這項服務托管在IIS服務器上時,但在將其移動到客戶端服務器后,通過瀏覽器調用方法時,我可以看到JSON數據。雖然只能通過WCF Test CLient看到,但是我無法從瀏覽器中看到數據。我錯了..你能建議應該怎么做。

 <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>

您需要在其中添加基本地址

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

然后,您的webHttpBinding端點“ ws”的相對地址將解析為

http://<URL to the .svc file>/ws

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM