0

SOAP / RPC(これは将来廃止される可能性があります)とRESTの両方をサポートするセルフホストサーバー(Windowsサービス)があります。RESTful GETは期待どおりに機能していますが、PUT / POSTで405エラーが発生しています(メソッドはサポートされていません)。これは私のapp.configの構成の問題であると確信していますが、これはかなり新しいので、何を試すべきかわかりません。

以下は私の設定ファイルです。どんな助けでも歓迎です...

  <system.serviceModel>
    <!-- bindings -->
    <bindings>
      <basicHttpBinding>
        <binding name ="soapBinding">
          <security mode="None" />
        </binding>
      </basicHttpBinding>
      <webHttpBinding>
        <binding name="webBinding" />
      </webHttpBinding>
    </bindings>
    <!-- behaviors -->
    <behaviors>
      <endpointBehaviors>
        <!-- plain old XML -->
        <behavior name="poxBehavior">
          <webHttp/>
        </behavior>
        <!-- JSON -->
        <behavior name="jsonBehavior">
          <enableWebScript  />
        </behavior>
      </endpointBehaviors>
      <serviceBehaviors>
        <behavior name="DSServerBehavior">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="True"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <!-- services -->
    <services>
      <service behaviorConfiguration="DSServerBehavior" name="dsServer.DSServer">
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8000/DecisionSupportServer" />
          </baseAddresses>
        </host>
        <endpoint address="soap" 
                  binding="basicHttpBinding" 
                  bindingConfiguration="soapBinding" 
                  contract="dsServer.IDSServer" />
        <endpoint address="mex" 
                  binding="mexHttpBinding" 
                  contract="IMetadataExchange" />
        <endpoint address="rest"
                  binding="webHttpBinding"
                  bindingConfiguration="webBinding"
                  behaviorConfiguration="poxBehavior"
                  contract="dsServer.IDSServer" />
      </service>
    </services>
  </system.serviceModel>
4

1 に答える 1

0

CURL を使用してこれを再確認し、クライアントに小さな変更を加えました。これは単純なユーザー エラーでした。:(

于 2009-10-06T15:03:07.773 に答える