ngx-soap icon indicating copy to clipboard operation
ngx-soap copied to clipboard

cannot find method when attempting to consume this service..

Open emaayan opened this issue 6 years ago • 9 comments

hi, i'm attempting to consume this service built by java se server jax-ws

these are my wsdl and schema file ParserWS.wsdl.txt ParserWS.xsd.txt

but the problem is that i keep "getting method not found" error which i believe was added in #26

this is my code ..

it would be nice to have a one shot sample, the sample you provided in the site is not one shot as it is split between 2 different events, the simplest example is one that could placed in one method which calls the wsdl , creates the client calls the services and returns a result. i'd be happy if i could have just a typescript file which does it. like a hello-world thing.

the sample itself also doesn't work out of the box ,this is because createClient returns a promise and not an observable, and i have to use "from" method to convert it to an observable.

`import {Component, OnInit} from '@angular/core'; import {Client, ISoapMethodResponse, NgxSoapService} from 'ngx-soap'; import {from} from 'rxjs';

@Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent implements OnInit { client: Client; title = 'TestAngularSoap'; private message: any;

constructor(private soap: NgxSoapService) { from(this.soap.createClient('http://localhost:8899/ParserWS?wsdl')).subscribe(client => this.client = client);

}

getClient(client) { return this.client = client; }

sum() {

}

go(): void { console.log(this.client); const body = { from: '0:00', to: '0:30' }; this.client.call('GetRecording', {}) .subscribe((res: ISoapMethodResponse) => { console.log(' got ${res}'); this.message = res.result.AddResult; }); }

ngOnInit(): void { /this.soap.createClient('assets/calculator.wsdl').subscribe(client => this.client = client);/

} }

`

emaayan avatar Jan 02 '19 11:01 emaayan

Hello @emaayan I believe you have issues when importing schema definitions:

<xsd:import namespace="http://aeroscout.ParserWSService.service/" schemaLocation="http://localhost:8899/ParserWS?xsd=1"></xsd:import>

If the schema definition is embedded in the wsdl operations are correctly generated and no "Method not found" error is returned.

Can you actually get http://localhost:8899/ParserWS?xsd=1? Have you checked you have no cors issues between client and server?

it would be nice to have a one shot sample, the sample you provided in the site is not one shot as it is split between 2 different events,

Check the example application source code. If you want everything in one place then you just embed you code in the promise result. If I understand what you're asking:

this.soap.createClient('/assets/test.wsdl')
      .then(client => {
        client.call('GetRecording', {}).subscribe(
          res => console.log('Res', res),
          err => console.log('Error', err)
        );
      })
      .catch(err => console.log(err));

lula avatar Jan 03 '19 11:01 lula

that's why i've attached the xsd file as well.. i had cors issues, but i've added the http header to the server... ngx-soap didn't report it had issues getting the xsd..

emaayan avatar Jan 03 '19 12:01 emaayan

Hi everybody, I am getting the same problem. I can see in my browser console my client is successfully created, even I can see inside bindings propertie of client object the methos I need to consume, but when I try to access to some method like ngx-soap readme says, I get some error, my method call its not found. const body = { idCliente: value.client, idUsuario: value.user, password: value. };

console.log('CLIENTE ANTES DEL LOGIN', this.client); (this.client).Login(body).subscribe((respon: ISoapMethodResponse) => console.log('SOAP', respon));

error ngx-soap error ngx-soap 1

yoan-asdrubal avatar Jan 18 '19 17:01 yoan-asdrubal

Hi everybody, I am getting the same problem. I can see in my browser console my client is successfully created, even I can see inside bindings propertie of client object the methos I need to consume, but when I try to access to some method like ngx-soap readme says, I get some error, my method call its not found. const body = { idCliente: value.client, idUsuario: value.user, password: value. };

console.log('CLIENTE ANTES DEL LOGIN', this.client); (this.client).Login(body).subscribe((respon: ISoapMethodResponse) => console.log('SOAP', respon));

error ngx-soap error ngx-soap 1

Did you get anywhere with this? I am also in same boat. Can see methods in the stack like you but cannot make a call

image

jay-aplan avatar Feb 07 '19 12:02 jay-aplan

@emaayan have you solved the problem with cors settings? Can this issue be closed? Thanks!

@yoan-asdrubal @jay-aplan please check if your wsdl has remote schemas like @emaayan had and if so be sure you have no cors errors

lula avatar Feb 11 '19 19:02 lula

Sorry guys, I did not resolve my issue with ngx-soap, I changed my solution, I made direct request passing xml with data and used response as I need.

yoan-asdrubal avatar Feb 11 '19 21:02 yoan-asdrubal

I am getting exactly the same issue with a 3rd party SOAP WSDL. I can't post it here because it is not ours, but I thought I would let you know.

nhc avatar Nov 29 '19 15:11 nhc

hi, do you find a solution? i have the same problem. thanks!

luchopal avatar Dec 23 '19 18:12 luchopal

Hi, I am having the same problem. XSD schema is accessible and I've resolved the CORS issue. But still getting the error. No clue.

iftekherislam avatar Mar 17 '21 17:03 iftekherislam