Access SOAP Web Service Using ServiceStack

I am creating a connection between the client and server applications with ServiceStack and it works fine, but I also need to access the external SOAP web service.

I tried to use it Soap12ServiceClientto access it, but I could not find any example, and then I sent a link to the WCF service, which actually worked, but created a ton of code.

Can it be used Soap12ServiceClientin the same simple way that I use JsonServiceClientto send a message / request and receive a message / response? If so, can you help or show me a sample?

+4
source share
1 answer

, , ServiceStack # Service Clients IServiceClient, . ServiceStack Hello World:

[TestFixture]
public class HelloWorldServiceClientTests
{
    public static IEnumerable ServiceClients
    {
        get
        {
            return new IServiceClient[] {
                new JsonServiceClient(Config.ServiceStackBaseUri),
                new JsvServiceClient(Config.ServiceStackBaseUri),
                new XmlServiceClient(Config.ServiceStackBaseUri),
                new Soap11ServiceClient(Config.ServiceStackBaseUri),
                new Soap12ServiceClient(Config.ServiceStackBaseUri)
            };
        }
    }

    [Test, TestCaseSource("ServiceClients")]
    public void HelloWorld_with_Sync_ServiceClients(IServiceClient client)
    {
        var response = client.Send<HelloResponse>(new Hello { Name = "World!" });

        Assert.That(response.Result, Is.EqualTo("Hello, World!"));
    }
}

SOAP #, , , SOAP SOAP, , , , , , SOAP, - , , , , .

, , InfoQ, SOAP .

+1

All Articles