1

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.

James Z
  • 12,209
  • 10
  • 24
  • 44
  • check your `clearText` settings. – Najam Us Saqib May 07 '21 at 09:51
  • @NajamUsSaqib , can you explain in a little detail, maybe provide a link or something. – Neeraj Upadhayay May 07 '21 at 21:26
  • Are you using Cordova or Capacitor? if Cordova check: https://stackoverflow.com/a/59310320/5909026 if you are using capacitor https://stackoverflow.com/a/65065936/5909026 – Najam Us Saqib May 08 '21 at 08:03
  • @NajamUsSaqib, I'm trying to make the api call in browser with "import { HttpClient } from '@angular/common/http" plugin, i think weather i'm using cordova or capacitor is irrelevant in browser context as they use angular plugins in browser, but to answer your question, I'm using cordova. Let me know if I'm missing something – Neeraj Upadhayay May 09 '21 at 14:49

0 Answers0