1

モバイル アプリケーションで使用される WCF RESTful アプリケーションを作成しています。これらのサービスを localhost に展開するとすべてが機能しますが、サーバーに展開すると 1 つのサービスのみが機能し、残りのすべてのサービスで「リモート サーバーがエラー 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>

ありがとう!

4

1 に答える 1

1

問題が何であるかはわかりませんが、WCFでのログインを有効にするのは非常に簡単です。発生するエラーは一般的なものであり、ロギングを有効にすると正しいエラーが表示されます。

この投稿を確認してください:http://intrepiddeveloper.wordpress.com/2008/08/07/security-event-logging-auditing/

于 2013-01-02T22:40:23.710 に答える