I'm looking for a way to send SOAP request to a web service, with a WSDL. Is it possible to do that with Typescript 2 and Angular 2 ?
I've seen tutorials for Angular 1 but they used old angular methodes, like factory
or controller
.
I would like if it's possible, a new way to do that with TypeScript.
Any ideas ?
You could use a regular http-request with Angular2's [
Http class
] (https://angular.io/docs/ts/latest/api/http/index/Http-class.html) This is an example from their page:instead of asking for a json file, you could use a URL instead.
What you need is a service that wraps around
Http
and provides deserialization:Then you can use it this way:
Since I'm not an xml parsing expert, I can't tell you how to deserialize your XML, but you can check MDN for that, you simply have to wrap the serialization/deserialization process in another service and inject it in your
SOAPService
.