lula / ngx-soap

Simple SOAP client for Angular
MIT License
66 stars 61 forks source link

TypeError: Cannot read property 'description' of undefined #109

Open SagarP62 opened 3 years ago

SagarP62 commented 3 years ago

Hi lena,

i am getting this error,

ERROR TypeError: Cannot read property 'description' of undefined at SAXParser.p.onopentag (ngx-soap.js:1377) at emit (sax.js:615) at emitNode (sax.js:620) at openTag (sax.js:801) at SAXParser.write (sax.js:1260) at WSDL.push../node_modules/ngx-soap/fesm2015/ngx-soap.js.WSDL.xmlToObject (ngx-soap.js:1572) at parseSync (ngx-soap.js:2810) at MapSubscriber.project (ngx-soap.js:2805) at MapSubscriber._next (map.js:29) at MapSubscriber.next (Subscriber.js:49)

I received a response properly. namely a WSDL document from my service.

any idea? update me if anything

thanks for advance

SagarP62 commented 3 years ago

this is my soap service call source code from angualr 8

constructor(private soap : NgxSoapService) { this.soap.createClient('http://localhost:8080/ws/loanEligibility.wsdl').then(client => { this.client = client; console.log('Created client!'); }) .catch(function(error) { console.log(error); }); }

ngOnInit() {

var body = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:loan="http://www.lti.com/soap/loaneligibility">'
+ '<soapenv:Header/>'
+ '<soapenv:Body>'
+   '<loan:CustomerRequest>'
+      '<loan:customerName>sagar</loan:customerName>'
+      '<loan:age>60</loan:age>'
+      '<loan:yearlyIncome>100000</loan:yearlyIncome>'
+      '<loan:cibilScore>500</loan:cibilScore>'
+      '<loan:employmentMode>govt</loan:employmentMode>'
+   '</loan:CustomerRequest>'
+'</soapenv:Body>'
+'</soapenv:Envelope>';

(<any>this.client).Customer(body).subscribe((res: ISoapMethodResponse) => this.message =  res.result.AddResult);
console.log("message:"+this.message);

}

raicerk commented 1 year ago

I have the same problem, does anyone know what can be?

seyfer commented 7 months ago

maybe try my updated version of this package?

https://github.com/lula/ngx-soap/issues/125#issuecomment-1898767558