簡體   English   中英

WCF遠程服務器返回錯誤400錯誤的請求

[英]WCF The remote server returned an error 400 bad request

我正在制作將在移動應用程序中使用的WCF RESTful應用程序。 當我在本地主機中部署這些服務時,所有這些都可以工作,但是當我在服務器中部署時,只有一項服務可以工作,其余所有都給我這個錯誤:“遠程服務器返回了錯誤400錯誤請求”。

我一直在尋找這個問題,發現它起源於web.config,因為它的配置方式不正確。 這是web.config,請幫助我。 我為此付出了努力。

<?xml version="1.0"?>
<configuration>

<system.web>
    <compilation debug="true" targetFramework="4.0" />
</system.web>

<system.serviceModel>

    <services>
        <service name="Servicios.Mobile" behaviorConfiguration="ServiceBehaviour">
            <endpoint address="" binding="webHttpBinding" bindingConfiguration="wsHttp" contract="Servicios.IMobile" behaviorConfiguration="web">
            </endpoint>         
        </service>
    </services>

    <behaviors>
        <serviceBehaviors>
            <behavior name="ServiceBehaviour">
                <serviceMetadata httpGetEnabled="true"/>
                <serviceDebug includeExceptionDetailInFaults="false"/>
            </behavior>
        </serviceBehaviors>
        <endpointBehaviors>
            <behavior name="web">
                <webHttp/>
            </behavior>
        </endpointBehaviors>
    </behaviors>

    <bindings>
        <webHttpBinding>
            <binding name="wsHttp" maxReceivedMessageSize="50000000" maxBufferPoolSize="50000000">
                <readerQuotas maxDepth="500000000" maxArrayLength="500000000" maxBytesPerRead="500000000" maxNameTableCharCount="500000000" maxStringContentLength="500000000"/>
            </binding>
        </webHttpBinding>
    </bindings>

    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />

</system.serviceModel>

<system.webServer>

    <modules runAllManagedModulesForAllRequests="true"/>

</system.webServer>

謝謝!

不知道是什么問題,但是在WCF中啟用日志記錄很容易。 您遇到的錯誤是一個普通錯誤,啟用日志記錄將顯示正確的錯誤。

檢查此帖子: http : //intrepiddeveloper.wordpress.com/2008/08/07/security-event-logging-auditing/

暫無
暫無

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

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