ServiceStack/ServiceStack.Examples — Issue #8: Errors with SOAP calls in v.3.21
Author: tsareg
Created: 2012-01-13 10:15:11+00:00
State: open

Here are steps to reproduce:
1. Open 'Properties' of ServiceStack.Examples.Host.Web project, go to 'Web', set 'Use Visual Studio Development Server', choose specific port, e.g. 6001
2. Run ServiceStack.Examples.Host.Web project, web-service will start.
3. Foe example, in ServiceStack.Examples.Clients 'Add Service Reference' referencing http://localhost:6001/servicestack/soap12, call it ServiceReference1.
4. Reference NUnit.Framework and add following SoapTest.cs somewhere:

using System.ServiceModel;
using NUnit.Framework;
using ServiceStack.Examples.Clients.ServiceReference1;

namespace ServiceStack.Examples.Clients
{
[TestFixture]
public class SoapTest
{
private const string EndpointUri = "http://localhost:6001/ServiceStack/soap12";

[Test]
public void Test()
{
var binding = new WSHttpBinding
{
MaxReceivedMessageSize = int.MaxValue,
HostNameComparisonMode = HostNameComparisonMode.StrongWildcard,
MaxBufferPoolSize = 524288,
};
binding.Security.Mode = SecurityMode.None;

var client = new SyncReplyClient(
binding,
new EndpointAddress(EndpointUri));

var result = client.GetFactorial(3);
Assert.AreEqual(6, result);
}
}
}

5. Run this test

In v3.17 everything is OK, test is passed.
In v.3.21 the following exception is raised:

System.ServiceModel.ProtocolException : The content type text/html; charset=utf-8 of the response message does not match the content type of the binding (application/soap+xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the response were: '

Value cannot be null.<br>Parameter name: httpReq

Server Error in '/' Application.

Valu'.
----> System.Net.WebException : The remote server returned an error: (500) Internal Server Error.