I tried to do it with two libraries: ngx-soap and soap, so far I could not.
This is a service that tries with the ngx-soap library.
import { Injectable } from '@angular/core';
import { NgxSoapService, ISoapMethod, Client, ISoapMethodResponse } from
'ngx-soap';
@Injectable({
providedIn: 'root'
})
export class SoapService {
client: Client;
private pin: 314;
private token: 4268;
public message: string;
public empresa: void;
public url: 'http://tbonline-webapp.azurewebsites.net/WebService.svc?wsdl';
constructor(private soap:NgxSoapService) {
this.soap.createClient(this.url).then(client => {
console.log('Cliente', client);
this.client = client;
})
.catch(err => console.log('Error', err));
}
obtenerLogin(){
const body = {
pin: this.pin,
token: this.token
};
(<any>this.client).GetLicenciaByPin(body).subscribe(res => {
console.log('method response', res);
this.xmlResponse = res.xml;
this.message = res.result.SubtractResult;
this.loading = false;
})
}
}