views:

471

answers:

1

Greetings!

I have a self-hosted server (Windows service) that is supporting both SOAP/RPC (this may go away in the future) and REST. The RESTful GETs are working as expected, but PUT/POST are giving a 405 error (Method Not Supported). I'm pretty sure this is a configuration issue with my app.config, but I'm pretty new to this and am not sure what to try.

Below is my config file. Any help would be greately appreciated...

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

I double-checked this using CURL and made a small change to my client. This was straight User Error. :(

Allan C