I have a Ionic 5 project with angular, and im trying to call a SOAP api endpoint to POST some data, but i'm getting this error.
headers: HttpHeaders {normalizedNames: Map(0), lazyUpdate: null, headers: Map(0)}
message: "Http failure response for http://nsi.isaix.com/C5IP/Authenticate.svc/AuthenticateUserClaims: 0 Unknown Error"
name: "HttpErrorResponse"
ok: false
status: 0
statusText: "Unknown Error"
url: "http://nsi.isaix.com/C5IP/Authenticate.svc/AuthenticateUserClaims"**
Below is the code i'm using to call the api.
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { map, catchError } from 'rxjs/operators';
import { environment } from 'src/environments/environment.prod';
// import { HTTP } from '@ionic-native/http/ngx';
import { NgxSoapService, Client, ISoapMethodResponse } from 'ngx-soap';
@Injectable({
providedIn: 'root'
})
export class AuthService {
client: Client;
private url = environment.url + 'apiendpoint';
constructor(
private http: HttpClient
) {}
login(data){
return this.http.post(this.url, data).toPromise();
}
Also i would like to add that i have used the '@ionic-native/http/ngx' plugin and the call was successfull, but as this is a native plugin and works only on device, and i want to make this work in browser.