How to consume a SOAP Webservice at Angular 7

Asked

Viewed 74 times

0

Guys, I’m trying to consume a SOAP Webservice in Angular 7, I’m using ngx-Soap in version 0.6.3, but I’m not succeeding, the project runs but when I try to access the resource the browser emits this error in the console:

ERROR TypeError: Cannot read property 'subscribe' of undefined
at RegistroComponent.push../src/app/correspondencia/registro/registro.component.ts.RegistroComponent.pesquisarSEI (registro.component.ts:183)
at Object.eval [as handleEvent] (RegistroComponent.html:76)
at handleEvent (core.js:23107)
at callWithDebugContext (core.js:24177)
at Object.debugHandleEvent [as handleEvent] (core.js:23904)
at dispatchEvent (core.js:20556)
at core.js:21003
at HTMLButtonElement.<anonymous> (platform-browser.js:993)
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:423)
at Object.onInvokeTask (core.js:17290)

My method:

public consultarProcesso(numeroProcesso?: string): Observable<ConsultarProcedimentoResponse> {

        if (numeroProcesso == undefined || numeroProcesso == null) {

            return new Observable<ConsultarProcedimentoResponse>();

        } else {

            this.soap.createClient('assets/ws_sei.wsdl')

                .then(client => {

                    let cliente: any = client;

                    let request: ConsultarProcedimentoRequest = {

                        SiglaSistema: 'SIPESWEB',

                        IdentificacaoServico: 'consultaProcessos',

                        IdUnidade: null,

                        ProtocoloProcedimento: numeroProcesso,

                        SinRetornarAssuntos: 'S',

                        SinRetornarInteressados: 'S',

                        SinRetornarObservacoes: 'S',

                        SinRetornarAndamentoGeracao: 'N',

                        SinRetornarAndamentoConclusao: 'N',

                        SinRetornarUltimoAndamento: 'N',

                        SinRetornarUnidadesProcedimentoAberto: 'N',

                        SinRetornarProcedimentosRelacionados: 'N',

                        SinRetornarProcedimentosAnexados: 'N'

                    }

                    return cliente.consultarProcedimento(request)

                        .subscrible(response => {

                            return response as Observable<ConsultarProcedimentoResponse>;

                        }, catchError(this.handleError),

                            publishReplay(1),

                            refCount()

                        )

                });

        }

    }

None of the posts I found here on the forum helped me.

If anyone has ever worked with this library, give me a hand!!!

From now on I thank you all!

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.