lula / ngx-soap

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

Client can't map Methods in wsdl #93

Closed isastim closed 3 years ago

isastim commented 3 years ago

Greetings,

I would like to use this library for this service. I was able to successfully interact with the API through POST requests. I had CORS errors when accessing the WSDL but fixed it by placing it manually in the assets folder and also with a proxy configuration. My code essentially looks like this:

  constructor(private http: HttpClient, private soap: NgxSoapService){
    this.soap.createClient('assets/mastr.wsdl').then(client => this.client = client).catch(err => console.log(err));  
  }
  test(){
    console.log(this.client);
    this.client.call('GetLokaleUhrzeit', {}).subscribe(res =>{});
  }

When calling the WSDL Method GetLokaleUhrzeit I get the error message ERROR Method GetLokaleUhrzeit not found. When logging the client object I cannot find any callable methods of the WSDL.

t4lpi commented 3 years ago

Greetings,

I would like to use this library for this service. I was able to successfully interact with the API through POST requests. I had CORS errors when accessing the WSDL but fixed it by placing it manually in the assets folder and also with a proxy configuration. My code essentially looks like this:

  constructor(private http: HttpClient, private soap: NgxSoapService){
    this.soap.createClient('assets/mastr.wsdl').then(client => this.client = client).catch(err => console.log(err));  
  }
  test(){
    console.log(this.client);
    this.client.call('GetLokaleUhrzeit', {}).subscribe(res =>{});
  }

When calling the WSDL Method GetLokaleUhrzeit I get the error message ERROR Method GetLokaleUhrzeit not found. When logging the client object I cannot find any callable methods of the WSDL.

Did you find any solution?

isastim commented 3 years ago

yesn't. I had tried this library a year ago. Maybe there is a solution now somewhere but at that time I decided to go with HTTP POST Requests and manually parse the XML with some parser libraries. To generate the typings we used wsdl-to-ts. Now we don't do this inside the Front-End anymore and built a Back-End component in Python with the zeep library.

lula commented 3 years ago

Hi all! This lib doesn't support inclusions (yet?). See WSDL types:


<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:import namespace="https://www.marktstammdatenregister.de/Services/Public/1_2/Modelle/Common" schemaLocation="../xsd/mastrservicetypes_common.xsd"/>
<xsd:import namespace="https://www.marktstammdatenregister.de/Services/Public/1_2/Modelle/Akteur" schemaLocation="../xsd/mastrservicetypes_akteur.xsd"/>
<xsd:import namespace="https://www.marktstammdatenregister.de/Services/Public/1_2/Modelle/Netzbetreiberpruefung" schemaLocation="../xsd/mastrservicetypes_netzbetreiberpruefung.xsd"/>
<xsd:import namespace="https://www.marktstammdatenregister.de/Services/Public/1_2/Modelle/Anlage" schemaLocation="../xsd/mastrservicetypes_anlage.xsd"/>
<xsd:import namespace="https://www.marktstammdatenregister.de/Services/Public/1_2/Modelle/Netzanschlusspunkt" schemaLocation="../xsd/mastrservicetypes_netzanschlusspunkt.xsd"/>
</xsd:schema>
</wsdl:types>```