ServiceStack's SOAP Support only supports ASP.NET Framework hosts which precludes it from running in an integration test which are run in a HttpListener Self Host, but your mileage may vary and may work in your case.
Here's a quick integration test example which checks the WSDL for a SOAP compatible ServiceStack Service:
[DataContract]
public class Hello : IReturn<HelloResponse>
{
[DataMember]
public string Name { get; set; }
}
[DataContract]
public class HelloResponse
{
[DataMember]
public string Result { get; set; }
}
class MyServices : Service
{
public object Any(Hello request) =>
new HelloResponse { Result = $"Hello, {request.Name}!" };
}
public class AppHost : AppSelfHostBase
{
public AppHost() : base("MyApp Tests", typeof(MyServices).Assembly) {}
public override void Configure(Container container)
{
Plugins.Add(new SoapFormat());
}
}
The integration test then just does a GET request to the /soap12 to retrieve its WSDL:
[TestFixture]
public class Tests
{
const string BaseUrl = "http://localhost:20000/";
ServiceStackHost appHost;
[OneTimeSetUp]
public void OneTimeSetUp() => appHost = new AppHost()
.Init()
.Start(BaseUrl);
[OneTimeTearDown]
public void OneTimeTearDown() => appHost.Dispose();
[Test]
public void Check_wsdl()
{
var wsdl = BaseUrl.CombineWith("soap12").GetJsonFromUrl();
wsdl.Print();
}
}
If the self-host doesn't work, you would need to test it against a running IIS/ASP.NET Host to fetch its WSDL.