I'm developing an Angular2 application. This app, call a WebService that return an Xml response. My Service class that call webservice has this method:
callPost() {
return this.http.post(this.baseUrl, '¶m=value'
, { headers: this.getHeaders() }).map(res => res);
}
where getHeaders function is
private getHeaders() {
let headers = new Headers();
headers.append('Content-Type', 'application/x-www-form-urlencoded');
return headers;
}
I call function inside my component class in this way:
this.myService.callPost().subscribe(
resp => this.resp = resp,
error => alert(error),
() => console.log(this.resp.text())
)
As i've noticed, xml response is inside this.resp.text()
Now i need to extract data from that xml (tag with attributes and value between tags), and i don't know how to do (i've stard developing in Angular2 yesterday). Can someone explane me how to procede?