Note that there are some explanatory texts on larger screens.

plurals
  1. POWebservice returns wrong content-type response header
    primarykey
    data
    text
    <p>I am trying to use third-party web service (php-based) in asp.net c# application, and failed with service configuration.Already tried add service/web reference - all the same error :</p> <blockquote> <p>The content type text/html of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 402 bytes of the response were: '&lt;?xml version="1.0" encoding="utf-8"?>&lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">&lt;soap:Body>;&lt;...</p> </blockquote> <p>[Response was edited manually to correctly display > &lt; chars, it's perfectly valid otherwise]</p> <p>To me it seems like a perfectly valid response, and I tried to look at what fiddler writes in response headers - Content-Type: text/html, which is probably the source of issue - webservice sents wrong content-type (text/html instead of text/xml) , but how to configure my client to ignore/override received content-type ? Googling gets me nothing so please, if anyone could help - where problem is? Binding\endpoint configuration is a default basicHttpBinding/endpoint which is generated by VS2010 when using Add Service Reference option, nothing was changed there. Thanks in advance.</p> <p>[app.config]</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;configuration&gt; &lt;configSections&gt; &lt;sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"&gt; &lt;section name="Collection.ServicePlayground.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/&gt; &lt;/sectionGroup&gt; &lt;/configSections&gt; &lt;system.serviceModel&gt; &lt;bindings&gt; &lt;basicHttpBinding&gt; &lt;binding name="SmsServiceSoap1" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"&gt; &lt;readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" /&gt; &lt;security mode="None"&gt; transport clientCredentialType="None" proxyCredentialType="None" realm="" /&gt; &lt;message clientCredentialType="UserName" algorithmSuite="Default" /&gt; &lt;/security&gt; &lt;/binding&gt; &lt;/basicHttpBinding&gt; &lt;/bindings&gt; &lt;client&gt; &lt;endpoint address="http://ws1.streamsms.ru/SmsService.php" binding="basicHttpBinding" bindingConfiguration="SmsServiceSoap1" contract="SmsService.SmsServiceSoap" name="SmsServiceSoap2" /&gt; &lt;/client&gt; &lt;/system.serviceModel&gt; &lt;applicationSettings&gt; &lt;Collection.ServicePlayground.Properties.Settings&gt; &lt;setting name="Collection_ServicePlayground_WSStreamProvider_SmsService" serializeAs="String"&gt; &lt;value&gt;http://ws1.streamsms.ru/SmsService.php&lt;/value&gt; &lt;/setting&gt; &lt;/Collection.ServicePlayground.Properties.Settings&gt; &lt;/applicationSettings&gt; &lt;/configuration&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload