SOAP WSDL Generate Code

ServicosPortSoap11 / cancelarLote

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
load ./chilkat.dll

set xml [new_CkXml]

CkXml_put_Tag $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_UpdateAttrAt $xml "soapenv:Body|cancelarLoteRequest|pedidoCancelamentoLote" 1 "versao" "?"
CkXml_UpdateChildContent $xml "soapenv:Body|cancelarLoteRequest|pedidoCancelamentoLote|CNPJ" "token string"
CkXml_UpdateChildContent $xml "soapenv:Body|cancelarLoteRequest|pedidoCancelamentoLote|cLote" "string"
CkXml_UpdateAttrAt $xml "soapenv:Body|cancelarLoteRequest|pedidoCancelamentoLote|ds:Signature" 1 "Id" "?"
CkXml_UpdateAttrAt $xml "soapenv:Body|cancelarLoteRequest|pedidoCancelamentoLote|ds:Signature|ds:SignedInfo" 1 "Id" "?"
CkXml_UpdateAttrAt $xml "soapenv:Body|cancelarLoteRequest|pedidoCancelamentoLote|ds:Signature|ds:SignedInfo|ds:CanonicalizationMethod" 1 "Algorithm" "http://www.w3.org/TR/2001/REC-xml-c14n-20010315"
CkXml_UpdateAttrAt $xml "soapenv:Body|cancelarLoteRequest|pedidoCancelamentoLote|ds:Signature|ds:SignedInfo|ds:SignatureMethod" 1 "Algorithm" "http://www.w3.org/2000/09/xmldsig#rsa-sha1"
CkXml_UpdateAttrAt $xml "soapenv:Body|cancelarLoteRequest|pedidoCancelamentoLote|ds:Signature|ds:SignedInfo|ds:Reference" 1 "Id" "?"
CkXml_UpdateAttrAt $xml "soapenv:Body|cancelarLoteRequest|pedidoCancelamentoLote|ds:Signature|ds:SignedInfo|ds:Reference" 1 "URI" "?"
CkXml_UpdateAttrAt $xml "soapenv:Body|cancelarLoteRequest|pedidoCancelamentoLote|ds:Signature|ds:SignedInfo|ds:Reference" 1 "Type" "?"
CkXml_UpdateAttrAt $xml "soapenv:Body|cancelarLoteRequest|pedidoCancelamentoLote|ds:Signature|ds:SignedInfo|ds:Reference|ds:Transforms|ds:Transform" 1 "Algorithm" "?"
CkXml_UpdateChildContent $xml "soapenv:Body|cancelarLoteRequest|pedidoCancelamentoLote|ds:Signature|ds:SignedInfo|ds:Reference|ds:Transforms|ds:Transform|ds:XPath" "string"
CkXml_UpdateAttrAt $xml "soapenv:Body|cancelarLoteRequest|pedidoCancelamentoLote|ds:Signature|ds:SignedInfo|ds:Reference|ds:DigestMethod" 1 "Algorithm" "http://www.w3.org/2000/09/xmldsig#sha1"
CkXml_UpdateChildContent $xml "soapenv:Body|cancelarLoteRequest|pedidoCancelamentoLote|ds:Signature|ds:SignedInfo|ds:Reference|ds:DigestValue" "BASE64_DATA"
CkXml_UpdateChildContent $xml "soapenv:Body|cancelarLoteRequest|pedidoCancelamentoLote|ds:Signature|ds:SignatureValue" "..."
CkXml_UpdateAttrAt $xml "soapenv:Body|cancelarLoteRequest|pedidoCancelamentoLote|ds:Signature|ds:KeyInfo" 1 "Id" "?"
CkXml_UpdateChildContent $xml "soapenv:Body|cancelarLoteRequest|pedidoCancelamentoLote|ds:Signature|ds:KeyInfo|ds:X509Data|ds:X509SubjectName" "string"
CkXml_UpdateChildContent $xml "soapenv:Body|cancelarLoteRequest|pedidoCancelamentoLote|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_put_EmitXmlDecl $xml 0
set soapRequestBody [CkXml_getXml $xml]

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

set http [new_CkHttp]

CkHttp_ClearHeaders $http
CkHttp_SetRequestHeader $http "Content-Type" $contentType
CkHttp_SetRequestHeader $http "SOAPAction" $soapAction

# resp is a CkHttpResponse
set resp [CkHttp_PostXml $http $endpoint $soapRequestBody "utf-8"]
if {[CkHttp_get_LastMethodSuccess $http] == 0} then {
    puts [CkHttp_lastErrorText $http]
    puts "Failed to send SOAP request."
    delete_CkXml $xml
    delete_CkHttp $http
    exit
}

# Get the XML response body.
set responseXml [new_CkXml]

CkHttpResponse_GetBodyXml $resp $responseXml

set statusCode [CkHttpResponse_get_StatusCode $resp]
puts "response status code: $statusCode"

delete_CkHttpResponse $resp

# If the status code does not indicate succcess, then show the response XML,
# which probably contains error information.
if {$statusCode != 200} then {
    puts [CkXml_getXml $responseXml]
    delete_CkXml $xml
    delete_CkHttp $http
    delete_CkXml $responseXml
    exit
}

puts [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).

set Envelope_xmlns [CkXml_getAttrValue $responseXml "xmlns"]
set confirmaCancelamentoLote_versao [CkXml_chilkatPath $responseXml "*:Body|cancelarLoteResponse|confirmaCancelamentoLote|(versao)"]
set CNPJ [CkXml_getChildContent $responseXml "*:Body|cancelarLoteResponse|confirmaCancelamentoLote|CNPJ"]
set cLote [CkXml_getChildContent $responseXml "*:Body|cancelarLoteResponse|confirmaCancelamentoLote|cLote"]
set dhRecbto [CkXml_getChildContent $responseXml "*:Body|cancelarLoteResponse|confirmaCancelamentoLote|dhRecbto"]
set sit [CkXml_getChildContent $responseXml "*:Body|cancelarLoteResponse|confirmaCancelamentoLote|sit"]
set mot [CkXml_getChildContent $responseXml "*:Body|cancelarLoteResponse|confirmaCancelamentoLote|mot"]
set Signature_Id [CkXml_chilkatPath $responseXml "*:Body|cancelarLoteResponse|confirmaCancelamentoLote|*:Signature|(Id)"]
set SignedInfo_Id [CkXml_chilkatPath $responseXml "*:Body|cancelarLoteResponse|confirmaCancelamentoLote|*:Signature|*:SignedInfo|(Id)"]
set CanonicalizationMethod_Algorithm [CkXml_chilkatPath $responseXml "*:Body|cancelarLoteResponse|confirmaCancelamentoLote|*:Signature|*:SignedInfo|*:CanonicalizationMethod|(Algorithm)"]
set SignatureMethod_Algorithm [CkXml_chilkatPath $responseXml "*:Body|cancelarLoteResponse|confirmaCancelamentoLote|*:Signature|*:SignedInfo|*:SignatureMethod|(Algorithm)"]
set Reference_Id [CkXml_chilkatPath $responseXml "*:Body|cancelarLoteResponse|confirmaCancelamentoLote|*:Signature|*:SignedInfo|*:Reference|(Id)"]
set Reference_URI [CkXml_chilkatPath $responseXml "*:Body|cancelarLoteResponse|confirmaCancelamentoLote|*:Signature|*:SignedInfo|*:Reference|(URI)"]
set Reference_Type [CkXml_chilkatPath $responseXml "*:Body|cancelarLoteResponse|confirmaCancelamentoLote|*:Signature|*:SignedInfo|*:Reference|(Type)"]
set Transform_Algorithm [CkXml_chilkatPath $responseXml "*:Body|cancelarLoteResponse|confirmaCancelamentoLote|*:Signature|*:SignedInfo|*:Reference|*:Transforms|*:Transform|(Algorithm)"]
set XPath [CkXml_getChildContent $responseXml "*:Body|cancelarLoteResponse|confirmaCancelamentoLote|*:Signature|*:SignedInfo|*:Reference|*:Transforms|*:Transform|*:XPath"]
set DigestMethod_Algorithm [CkXml_chilkatPath $responseXml "*:Body|cancelarLoteResponse|confirmaCancelamentoLote|*:Signature|*:SignedInfo|*:Reference|*:DigestMethod|(Algorithm)"]
set DigestValue [CkXml_getChildContent $responseXml "*:Body|cancelarLoteResponse|confirmaCancelamentoLote|*:Signature|*:SignedInfo|*:Reference|*:DigestValue"]
set SignatureValue [CkXml_getChildContent $responseXml "*:Body|cancelarLoteResponse|confirmaCancelamentoLote|*:Signature|*:SignatureValue"]
set KeyInfo_Id [CkXml_chilkatPath $responseXml "*:Body|cancelarLoteResponse|confirmaCancelamentoLote|*:Signature|*:KeyInfo|(Id)"]
set X509SubjectName [CkXml_getChildContent $responseXml "*:Body|cancelarLoteResponse|confirmaCancelamentoLote|*:Signature|*:KeyInfo|*:X509Data|*:X509SubjectName"]
set X509Certificate [CkXml_getChildContent $responseXml "*:Body|cancelarLoteResponse|confirmaCancelamentoLote|*:Signature|*:KeyInfo|*:X509Data|*:X509Certificate"]

delete_CkXml $xml
delete_CkHttp $http
delete_CkXml $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>
        <cancelarLoteRequest>
            <pedidoCancelamentoLote versao="?">
                <CNPJ>token string</CNPJ>
                <cLote>string</cLote>
                <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>
            </pedidoCancelamentoLote>
        </cancelarLoteRequest>
    </soapenv:Body>
</soapenv:Envelope>
Response 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>
        <cancelarLoteResponse>
            <confirmaCancelamentoLote versao="?">
                <CNPJ>token string</CNPJ>
                <cLote>string</cLote>
                <dhRecbto>string</dhRecbto>
                <sit>positiveInteger</sit>
                <mot>string</mot>
                <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>
            </confirmaCancelamentoLote>
        </cancelarLoteResponse>
    </soapenv:Body>
</soapenv:Envelope>