Viene visualizzato l'errore di errore sotto durante il tentativo di aggiungere il servizio WCF a WCFTestClient. Ho trovato il numero di soluzioni sul web ma non sono riuscito a farlo funzionare.Tipo di contenuto application/soap + xml; charset = utf-8 non era supportato dal servizio
Qualcuno può aiutarmi con i problemi? Sono anche fornendo mio file di configurazione per il servizio:
Content Type application/soap+xml; charset=utf-8 was not supported by service The client and service bindings may be mismatched. The remote server returned an error: (415) Cannot process the message because the content type 'application/soap+xml; charset=utf-8' was not the expected type 'text/xml; charset=utf-8
Codice:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<compilation debug="true" />
</system.web>
<!-- When deploying the service library project, the content of the config file
must be added to the host's app.config file. System.Configuration does not
support config files for libraries. -->
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="basicHttp" allowCookies="true"
maxReceivedMessageSize="20000000"
maxBufferSize="20000000"
maxBufferPoolSize="20000000">
<readerQuotas maxDepth="32"
maxArrayLength="200000000"
maxStringContentLength="200000000"/>
</binding>
</basicHttpBinding>
</bindings>
<services>
<service name="WCFTradeLibrary.TradeService">
<endpoint address="" binding="basicHttpBinding"
bindingConfiguration="basicHttp"
contract="WCFTradeLibrary.ITradeService">
</endpoint>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information,
set the value below to false and remove the metadata endpoint
above before deployment -->
<serviceMetadata httpGetEnabled="true"/>
<!-- To receive exception details in faul`enter code here`ts for
debugging purposes,
set the value below to true. Set to false before deployment
to avoid disclosing exception info`enter code here`rmation -->
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
Possibile duplicato: http://stackoverflow.com/questions/8087515/wcf-service-using-basichttpbinding-is-still-sending-content-type-text-xml?rq=1 –
Questa è una vecchia domanda ma si presenta come la prima risposta in Google. Voglio solo sottolineare che il messaggio di errore potrebbe essere fuorviante. L'errore sottostante potrebbe essere del tutto estraneo .... che mi è successo. – sean717
Ho ricevuto questo errore quando ho aggiunto un costruttore a una classe. – MC9000