am actually interacting with a SOAP webservice which makes a POST request and returns a response with status 200 and an xml file, but when I want to catch that message I receive the following response: "SyntaxError: Unexpected token <in JSON at position 0 at JSON.parse () at XMLHttpRequest.onLoad "
service:
emision(body): Observable<any> {
let httpOptions = {
headers: new HttpHeaders({
'Authorization': "*********",
'Action': "postproduct",
})
};
return this.http.post('/api/******',
body, httpOptions)
}
subscribe:
this.mainService.emision(obj).subscribe(
(value) => {
console.log(value);
},
(error) => {
console.log(error);
console.warn(
"ERROR CONEXION"
);
}
);
Although when I enter the console and then in network I can verify that the response is with status 200 and a response in xml format, when I want to catch the response it generates an httpResponseError with the following message "SyntaxError: Unexpected token <in JSON at position 0 at JSON.parse () at XMLHttpRequest.onLoad "