Skip to main content

SOAP

Webservice que permite enviar solicitações para APIs SOAP.

const soap = require("@devapi/engine/soap");
const connectionParams = {
wsdl: "https://apps.correios.com.br/SigepMasterJPA/AtendeClienteService/AtendeCliente?wsdl",
// username: 'username', If the webservice has Basic auth authentication you must enter this field
// password: 'password' If the webservice has Basic auth authentication you must enter this field
};
const connectionOptions = {
// disableCache: boolean, don't cache WSDL files, request them every time.
// endpoint: string, override the SOAP service's host specified in the .wsdl file.
// envelopeKey: string, set specific key instead of<pre>< soap: Body></soap: Body ></pre >.
// overridePromiseSuffix: string, if your wsdl operations contains names with Async suffix, you will need to override the default promise suffix to a custom one, default: Async.
};
const client = await soap.connect(connectionParams, connectionOptions);
// If the webservice has Basic auth authentication you must connect at your client using the method below
// const client = soap.connectBasic(connectionParams, connectionOptions);
const group = "AtendeClienteService";
const servicePath = "AtendeClientePort.consultaCEP";
const body = {
cep: "00000000",
};
const result = await soap.request(client, group, servicePath, body);