SOAP WSDL Generate Code

ServicosPortSoap11 / corrigirNFSe

ASP AutoIt C C (Unicode) C++ C++ (Unicode) C# DataFlex Delphi Foxpro Go Java Node.js Objective-C Perl PHP Extension PowerBuilder Powershell PureBasic Python CkPython Ruby SQL Server Swift TCL VB.NET VB6 VBScript Xojo
var
xml: HCkXml;
soapRequestBody: PWideChar;
endpoint: PWideChar;
soapAction: PWideChar;
contentType: PWideChar;
http: HCkHttp;
resp: HCkHttpResponse;
responseXml: HCkXml;
statusCode: Integer;

begin
xml := CkXml_Create();
CkXml_putTag(xml,'soapenv:Envelope');
CkXml_AddAttribute(xml,'xmlns:soapenv','http://schemas.xmlsoap.org/soap/envelope/');
CkXml_AddAttribute(xml,'xmlns','http://ws.pc.gif.com.br/');
CkXml_AddAttribute(xml,'xmlns:nfs','http://nfse.abrasf.org.br');
CkXml_AddAttribute(xml,'xmlns:ds','http://www.w3.org/2000/09/xmldsig#');
CkXml_UpdateChildContent(xml,'soapenv:Header','');
CkXml_UpdateChildContent(xml,'soapenv:Body|corrigirNFSeRequest|cartaCorrecao|idCC|chaveAcesso','string');
CkXml_UpdateChildContent(xml,'soapenv:Body|corrigirNFSeRequest|cartaCorrecao|idCC|cnpjCpf','string');
CkXml_UpdateChildContent(xml,'soapenv:Body|corrigirNFSeRequest|cartaCorrecao|tomadorCC|email','string');
CkXml_UpdateChildContent(xml,'soapenv:Body|corrigirNFSeRequest|cartaCorrecao|tomadorCC|telefone','token string');
CkXml_UpdateChildContent(xml,'soapenv:Body|corrigirNFSeRequest|cartaCorrecao|tomadorCC|inscricaoMunicipal','string');
CkXml_UpdateChildContent(xml,'soapenv:Body|corrigirNFSeRequest|cartaCorrecao|tomadorCC|inscricaoEstadual','string');
CkXml_UpdateChildContent(xml,'soapenv:Body|corrigirNFSeRequest|cartaCorrecao|tomadorCC|cep','token string');
CkXml_UpdateChildContent(xml,'soapenv:Body|corrigirNFSeRequest|cartaCorrecao|tomadorCC|logradouro','string');
CkXml_UpdateChildContent(xml,'soapenv:Body|corrigirNFSeRequest|cartaCorrecao|tomadorCC|numeroLogradouro','string');
CkXml_UpdateChildContent(xml,'soapenv:Body|corrigirNFSeRequest|cartaCorrecao|tomadorCC|bairro','string');
CkXml_UpdateChildContent(xml,'soapenv:Body|corrigirNFSeRequest|cartaCorrecao|construcaoCC|numeroART','string');
CkXml_UpdateChildContent(xml,'soapenv:Body|corrigirNFSeRequest|cartaCorrecao|construcaoCC|numeroCEI','string');
CkXml_UpdateChildContent(xml,'soapenv:Body|corrigirNFSeRequest|cartaCorrecao|construcaoCC|numeroMatricula','string');
CkXml_UpdateChildContent(xml,'soapenv:Body|corrigirNFSeRequest|cartaCorrecao|construcaoCC|numeroProjeto','string');
CkXml_UpdateChildContent(xml,'soapenv:Body|corrigirNFSeRequest|cartaCorrecao|transportadoraCC|cnpjCpf','string');
CkXml_UpdateChildContent(xml,'soapenv:Body|corrigirNFSeRequest|cartaCorrecao|transportadoraCC|nome','string');
CkXml_UpdateChildContent(xml,'soapenv:Body|corrigirNFSeRequest|cartaCorrecao|transportadoraCC|inscricaoEstadual','string');
CkXml_UpdateChildContent(xml,'soapenv:Body|corrigirNFSeRequest|cartaCorrecao|transportadoraCC|placaVeiculo','string');
CkXml_UpdateChildContent(xml,'soapenv:Body|corrigirNFSeRequest|cartaCorrecao|transportadoraCC|endereco','string');
CkXml_UpdateChildContent(xml,'soapenv:Body|corrigirNFSeRequest|cartaCorrecao|transportadoraCC|nomeCidade','string');
CkXml_UpdateChildContent(xml,'soapenv:Body|corrigirNFSeRequest|cartaCorrecao|transportadoraCC|codigoCidade','token string');
CkXml_UpdateChildContent(xml,'soapenv:Body|corrigirNFSeRequest|cartaCorrecao|transportadoraCC|uf','EX');
CkXml_UpdateChildContent(xml,'soapenv:Body|corrigirNFSeRequest|cartaCorrecao|transportadoraCC|nomePais','string');
CkXml_UpdateChildContent(xml,'soapenv:Body|corrigirNFSeRequest|cartaCorrecao|transportadoraCC|codigoPais','token string');
CkXml_UpdateChildContent(xml,'soapenv:Body|corrigirNFSeRequest|cartaCorrecao|transportadoraCC|tipoFrete','token string');
CkXml_UpdateChildContent(xml,'soapenv:Body|corrigirNFSeRequest|cartaCorrecao|servicosCC|servicoCC|ordem','positiveInteger');
CkXml_UpdateChildContent(xml,'soapenv:Body|corrigirNFSeRequest|cartaCorrecao|servicosCC|servicoCC|descricao','string');
CkXml_UpdateChildContent(xml,'soapenv:Body|corrigirNFSeRequest|cartaCorrecao|faturasCC|faturaCC|ordem','positiveInteger');
CkXml_UpdateChildContent(xml,'soapenv:Body|corrigirNFSeRequest|cartaCorrecao|faturasCC|faturaCC|numero','string');
CkXml_UpdateChildContent(xml,'soapenv:Body|corrigirNFSeRequest|cartaCorrecao|faturasCC|faturaCC|dataVencimento','date');
CkXml_UpdateChildContent(xml,'soapenv:Body|corrigirNFSeRequest|cartaCorrecao|observacoesCC|observacaoCC|ordem','positiveInteger');
CkXml_UpdateChildContent(xml,'soapenv:Body|corrigirNFSeRequest|cartaCorrecao|observacoesCC|observacaoCC|descricao','string');
CkXml_UpdateAttrAt(xml,'soapenv:Body|corrigirNFSeRequest|cartaCorrecao|ds:Signature',True,'Id','?');
CkXml_UpdateAttrAt(xml,'soapenv:Body|corrigirNFSeRequest|cartaCorrecao|ds:Signature|ds:SignedInfo',True,'Id','?');
CkXml_UpdateAttrAt(xml,'soapenv:Body|corrigirNFSeRequest|cartaCorrecao|ds:Signature|ds:SignedInfo|ds:CanonicalizationMethod',True,'Algorithm','http://www.w3.org/TR/2001/REC-xml-c14n-20010315');
CkXml_UpdateAttrAt(xml,'soapenv:Body|corrigirNFSeRequest|cartaCorrecao|ds:Signature|ds:SignedInfo|ds:SignatureMethod',True,'Algorithm','http://www.w3.org/2000/09/xmldsig#rsa-sha1');
CkXml_UpdateAttrAt(xml,'soapenv:Body|corrigirNFSeRequest|cartaCorrecao|ds:Signature|ds:SignedInfo|ds:Reference',True,'Id','?');
CkXml_UpdateAttrAt(xml,'soapenv:Body|corrigirNFSeRequest|cartaCorrecao|ds:Signature|ds:SignedInfo|ds:Reference',True,'URI','?');
CkXml_UpdateAttrAt(xml,'soapenv:Body|corrigirNFSeRequest|cartaCorrecao|ds:Signature|ds:SignedInfo|ds:Reference',True,'Type','?');
CkXml_UpdateAttrAt(xml,'soapenv:Body|corrigirNFSeRequest|cartaCorrecao|ds:Signature|ds:SignedInfo|ds:Reference|ds:Transforms|ds:Transform',True,'Algorithm','?');
CkXml_UpdateChildContent(xml,'soapenv:Body|corrigirNFSeRequest|cartaCorrecao|ds:Signature|ds:SignedInfo|ds:Reference|ds:Transforms|ds:Transform|ds:XPath','string');
CkXml_UpdateAttrAt(xml,'soapenv:Body|corrigirNFSeRequest|cartaCorrecao|ds:Signature|ds:SignedInfo|ds:Reference|ds:DigestMethod',True,'Algorithm','http://www.w3.org/2000/09/xmldsig#sha1');
CkXml_UpdateChildContent(xml,'soapenv:Body|corrigirNFSeRequest|cartaCorrecao|ds:Signature|ds:SignedInfo|ds:Reference|ds:DigestValue','BASE64_DATA');
CkXml_UpdateChildContent(xml,'soapenv:Body|corrigirNFSeRequest|cartaCorrecao|ds:Signature|ds:SignatureValue','...');
CkXml_UpdateAttrAt(xml,'soapenv:Body|corrigirNFSeRequest|cartaCorrecao|ds:Signature|ds:KeyInfo',True,'Id','?');
CkXml_UpdateChildContent(xml,'soapenv:Body|corrigirNFSeRequest|cartaCorrecao|ds:Signature|ds:KeyInfo|ds:X509Data|ds:X509SubjectName','string');
CkXml_UpdateChildContent(xml,'soapenv:Body|corrigirNFSeRequest|cartaCorrecao|ds:Signature|ds:KeyInfo|ds:X509Data|ds:X509Certificate','BqozVXeZZg==');

// In a SOAP HTTP request, including the XML declaration (<?xml version="1.0" encoding="UTF-8"?>) in the XML body is generally not required. 
CkXml_putEmitXmlDecl(xml,False);
soapRequestBody := CkXml__getXml(xml);

endpoint := 'https://canoas-homol.infisc.com.br/services/nfse/ws/Servicos';
soapAction := '';
//  For SOAP requests, the standard Content-Type is usually set to "text/xml" or "application/soap+xml"
contentType := 'text/xml';

http := CkHttp_Create();

CkHttp_ClearHeaders(http);
CkHttp_SetRequestHeader(http,'Content-Type',contentType);
CkHttp_SetRequestHeader(http,'SOAPAction',soapAction);

resp := CkHttp_PostXml(http,endpoint,soapRequestBody,'utf-8');
if (CkHttp_getLastMethodSuccess(http) = False) then
  begin
    Memo1.Lines.Add(CkHttp__lastErrorText(http));
    Memo1.Lines.Add('Failed to send SOAP request.');
    Exit;
  end;

// Get the XML response body.
responseXml := CkXml_Create();
CkHttpResponse_GetBodyXml(resp,responseXml);

statusCode := CkHttpResponse_getStatusCode(resp);
Memo1.Lines.Add('response status code: ' + IntToStr(statusCode));

CkHttpResponse_Dispose(resp);

// If the status code does not indicate succcess, then show the response XML,
// which probably contains error information.
if (statusCode <> 200) then
  begin
    Memo1.Lines.Add(CkXml__getXml(responseXml));
    Exit;
  end;

Memo1.Lines.Add(CkXml__getXml(responseXml));

// Parse the successful SOAP response XML.

// This is a sample of the response XML, but the namespace prefixes will be different.
// We can parse the result using "*" for the namespace prefixes (see below).

CkXml_Dispose(xml);
CkHttp_Dispose(http);
CkXml_Dispose(responseXml);

Request XML
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://ws.pc.gif.com.br/" xmlns:nfs="http://nfse.abrasf.org.br" xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
    <soapenv:Header/>
    <soapenv:Body>
        <corrigirNFSeRequest>
            <cartaCorrecao>
                <idCC>
                    <chaveAcesso>string</chaveAcesso>
                    <cnpjCpf>string</cnpjCpf>
                </idCC>
                <tomadorCC>
                    <email>string</email>
                    <telefone>token string</telefone>
                    <inscricaoMunicipal>string</inscricaoMunicipal>
                    <inscricaoEstadual>string</inscricaoEstadual>
                    <cep>token string</cep>
                    <logradouro>string</logradouro>
                    <numeroLogradouro>string</numeroLogradouro>
                    <bairro>string</bairro>
                </tomadorCC>
                <construcaoCC>
                    <numeroART>string</numeroART>
                    <numeroCEI>string</numeroCEI>
                    <numeroMatricula>string</numeroMatricula>
                    <numeroProjeto>string</numeroProjeto>
                </construcaoCC>
                <transportadoraCC>
                    <cnpjCpf>string</cnpjCpf>
                    <nome>string</nome>
                    <inscricaoEstadual>string</inscricaoEstadual>
                    <placaVeiculo>string</placaVeiculo>
                    <endereco>string</endereco>
                    <nomeCidade>string</nomeCidade>
                    <codigoCidade>token string</codigoCidade>
                    <uf>EX</uf>
                    <nomePais>string</nomePais>
                    <codigoPais>token string</codigoPais>
                    <tipoFrete>token string</tipoFrete>
                </transportadoraCC>
                <servicosCC>
                    <servicoCC>
                        <ordem>positiveInteger</ordem>
                        <descricao>string</descricao>
                    </servicoCC>
                </servicosCC>
                <faturasCC>
                    <faturaCC>
                        <ordem>positiveInteger</ordem>
                        <numero>string</numero>
                        <dataVencimento>date</dataVencimento>
                    </faturaCC>
                </faturasCC>
                <observacoesCC>
                    <observacaoCC>
                        <ordem>positiveInteger</ordem>
                        <descricao>string</descricao>
                    </observacaoCC>
                </observacoesCC>
                <ds:Signature Id="?">
                    <ds:SignedInfo Id="?">
                        <ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
                        <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
                        <ds:Reference Id="?" URI="?" Type="?">
                            <ds:Transforms>
                                <ds:Transform Algorithm="?">
                                    <ds:XPath>string</ds:XPath>
                                </ds:Transform>
                            </ds:Transforms>
                            <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
                            <ds:DigestValue>BASE64_DATA</ds:DigestValue>
                        </ds:Reference>
                    </ds:SignedInfo>
                    <ds:SignatureValue>...</ds:SignatureValue>
                    <ds:KeyInfo Id="?">
                        <ds:X509Data>
                            <ds:X509SubjectName>string</ds:X509SubjectName>
                            <ds:X509Certificate>BqozVXeZZg==</ds:X509Certificate>
                        </ds:X509Data>
                    </ds:KeyInfo>
                </ds:Signature>
            </cartaCorrecao>
        </corrigirNFSeRequest>
    </soapenv:Body>
</soapenv:Envelope>
Response XML
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"/>