Mark
Mark

Reputation: 2203

Servicestack - injecting a SOAP web service

I would like to call a third-party SOAP web service from within my ServiceStack project ( I have used the default servicestack project layout: enter image description here.

Now, I would like to create a normal Request DTO class (in the servicestack.models projrct). This request is then handled in the ServiceStack.Interfaces project. When handling this request, I would like to call a third party soap service& apply some logic and return a custom response DTO.

However, I am getting stuck in trying to call the relevant SOAP service from the Servicestack.Interfaces project.

Try Number 1:
I have tried adding the SOAP service reference to the ServiceStack.Interface (by 'Add Reference...'). However, when trying to call the SOAP Service (from within the ServiceStack.Interfaces project), I get an error message saying 'no endpoint defined/found for this SOAP webservice'.

Try Number 2:
I have tried adding the SOAP service reference to the ServiceStack main project. However,now I am stuck on trying to inject this service so I can call it from the ServiceStack.Interfaces project.

Any help is appreciated,
Mark

Upvotes: 0

Views: 212

Answers (2)

Mark
Mark

Reputation: 2203

For anyone running into the same issues, I got it working by adding the Soap Service endpoint configuration to the main project's configuration file. After that I was able to query the SOAP service from the WebApplication.ServiceInterface project.

Upvotes: 1

PatrickSteele
PatrickSteele

Reputation: 14677

From this comment, I don't think you'll be able to use a ServiceStack client to access the third party SOAP service (unless, of course, they've built the service using ServiceStack).

In this case, I would simply use some XML serialization and an HTTP POST (followed by some XML deserialization of the response).

Upvotes: 1

Related Questions