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
$oXml = ObjCreate("Chilkat_9_5_0.Xml")
$oXml.Tag = "soapenv:Envelope"
$oXml.AddAttribute("xmlns:soapenv","http://schemas.xmlsoap.org/soap/envelope/")
$oXml.AddAttribute("xmlns","http://ws.pc.gif.com.br/")
$oXml.AddAttribute("xmlns:nfs","http://nfse.abrasf.org.br")
$oXml.AddAttribute("xmlns:ds","http://www.w3.org/2000/09/xmldsig#")
$oXml.UpdateChildContent "soapenv:Header",""
$oXml.UpdateAttrAt("soapenv:Body|cancelarLoteRequest|pedidoCancelamentoLote",True,"versao","?")
$oXml.UpdateChildContent "soapenv:Body|cancelarLoteRequest|pedidoCancelamentoLote|CNPJ","token string"
$oXml.UpdateChildContent "soapenv:Body|cancelarLoteRequest|pedidoCancelamentoLote|cLote","string"
$oXml.UpdateAttrAt("soapenv:Body|cancelarLoteRequest|pedidoCancelamentoLote|ds:Signature",True,"Id","?")
$oXml.UpdateAttrAt("soapenv:Body|cancelarLoteRequest|pedidoCancelamentoLote|ds:Signature|ds:SignedInfo",True,"Id","?")
$oXml.UpdateAttrAt("soapenv:Body|cancelarLoteRequest|pedidoCancelamentoLote|ds:Signature|ds:SignedInfo|ds:CanonicalizationMethod",True,"Algorithm","http://www.w3.org/TR/2001/REC-xml-c14n-20010315")
$oXml.UpdateAttrAt("soapenv:Body|cancelarLoteRequest|pedidoCancelamentoLote|ds:Signature|ds:SignedInfo|ds:SignatureMethod",True,"Algorithm","http://www.w3.org/2000/09/xmldsig#rsa-sha1")
$oXml.UpdateAttrAt("soapenv:Body|cancelarLoteRequest|pedidoCancelamentoLote|ds:Signature|ds:SignedInfo|ds:Reference",True,"Id","?")
$oXml.UpdateAttrAt("soapenv:Body|cancelarLoteRequest|pedidoCancelamentoLote|ds:Signature|ds:SignedInfo|ds:Reference",True,"URI","?")
$oXml.UpdateAttrAt("soapenv:Body|cancelarLoteRequest|pedidoCancelamentoLote|ds:Signature|ds:SignedInfo|ds:Reference",True,"Type","?")
$oXml.UpdateAttrAt("soapenv:Body|cancelarLoteRequest|pedidoCancelamentoLote|ds:Signature|ds:SignedInfo|ds:Reference|ds:Transforms|ds:Transform",True,"Algorithm","?")
$oXml.UpdateChildContent "soapenv:Body|cancelarLoteRequest|pedidoCancelamentoLote|ds:Signature|ds:SignedInfo|ds:Reference|ds:Transforms|ds:Transform|ds:XPath","string"
$oXml.UpdateAttrAt("soapenv:Body|cancelarLoteRequest|pedidoCancelamentoLote|ds:Signature|ds:SignedInfo|ds:Reference|ds:DigestMethod",True,"Algorithm","http://www.w3.org/2000/09/xmldsig#sha1")
$oXml.UpdateChildContent "soapenv:Body|cancelarLoteRequest|pedidoCancelamentoLote|ds:Signature|ds:SignedInfo|ds:Reference|ds:DigestValue","BASE64_DATA"
$oXml.UpdateChildContent "soapenv:Body|cancelarLoteRequest|pedidoCancelamentoLote|ds:Signature|ds:SignatureValue","..."
$oXml.UpdateAttrAt("soapenv:Body|cancelarLoteRequest|pedidoCancelamentoLote|ds:Signature|ds:KeyInfo",True,"Id","?")
$oXml.UpdateChildContent "soapenv:Body|cancelarLoteRequest|pedidoCancelamentoLote|ds:Signature|ds:KeyInfo|ds:X509Data|ds:X509SubjectName","string"
$oXml.UpdateChildContent "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. 
$oXml.EmitXmlDecl = False
Local $soapRequestBody = $oXml.GetXml()

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

$oHttp = ObjCreate("Chilkat_9_5_0.Http")

$oHttp.ClearHeaders 
$oHttp.SetRequestHeader "Content-Type",$sContentType
$oHttp.SetRequestHeader "SOAPAction",$soapAction

Local $oResp = $oHttp.PostXml($sEndpoint,$soapRequestBody,"utf-8")
If ($oHttp.LastMethodSuccess = False) Then
    ConsoleWrite($oHttp.LastErrorText & @CRLF)
    ConsoleWrite("Failed to send SOAP request." & @CRLF)
    Exit
EndIf

; Get the XML response body.
$oResponseXml = ObjCreate("Chilkat_9_5_0.Xml")
$oResp.GetBodyXml($oResponseXml)

Local $iStatusCode = $oResp.StatusCode
ConsoleWrite("response status code: " & $iStatusCode & @CRLF)

; If the status code does not indicate succcess, then show the response XML,
; which probably contains error information.
If ($iStatusCode <> 200) Then
    ConsoleWrite($oResponseXml.GetXml() & @CRLF)
    Exit
EndIf

ConsoleWrite($oResponseXml.GetXml() & @CRLF)

; 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).

Local $sEnvelope_xmlns = $oResponseXml.GetAttrValue("xmlns")
Local $sConfirmaCancelamentoLote_versao = $oResponseXml.ChilkatPath("*:Body|cancelarLoteResponse|confirmaCancelamentoLote|(versao)")
Local $sCNPJ = $oResponseXml.GetChildContent("*:Body|cancelarLoteResponse|confirmaCancelamentoLote|CNPJ")
Local $sCLote = $oResponseXml.GetChildContent("*:Body|cancelarLoteResponse|confirmaCancelamentoLote|cLote")
Local $sDhRecbto = $oResponseXml.GetChildContent("*:Body|cancelarLoteResponse|confirmaCancelamentoLote|dhRecbto")
Local $sit = $oResponseXml.GetChildContent("*:Body|cancelarLoteResponse|confirmaCancelamentoLote|sit")
Local $sMot = $oResponseXml.GetChildContent("*:Body|cancelarLoteResponse|confirmaCancelamentoLote|mot")
Local $sSignature_Id = $oResponseXml.ChilkatPath("*:Body|cancelarLoteResponse|confirmaCancelamentoLote|*:Signature|(Id)")
Local $sSignedInfo_Id = $oResponseXml.ChilkatPath("*:Body|cancelarLoteResponse|confirmaCancelamentoLote|*:Signature|*:SignedInfo|(Id)")
Local $sCanonicalizationMethod_Algorithm = $oResponseXml.ChilkatPath("*:Body|cancelarLoteResponse|confirmaCancelamentoLote|*:Signature|*:SignedInfo|*:CanonicalizationMethod|(Algorithm)")
Local $sSignatureMethod_Algorithm = $oResponseXml.ChilkatPath("*:Body|cancelarLoteResponse|confirmaCancelamentoLote|*:Signature|*:SignedInfo|*:SignatureMethod|(Algorithm)")
Local $sReference_Id = $oResponseXml.ChilkatPath("*:Body|cancelarLoteResponse|confirmaCancelamentoLote|*:Signature|*:SignedInfo|*:Reference|(Id)")
Local $sReference_URI = $oResponseXml.ChilkatPath("*:Body|cancelarLoteResponse|confirmaCancelamentoLote|*:Signature|*:SignedInfo|*:Reference|(URI)")
Local $sReference_Type = $oResponseXml.ChilkatPath("*:Body|cancelarLoteResponse|confirmaCancelamentoLote|*:Signature|*:SignedInfo|*:Reference|(Type)")
Local $sTransform_Algorithm = $oResponseXml.ChilkatPath("*:Body|cancelarLoteResponse|confirmaCancelamentoLote|*:Signature|*:SignedInfo|*:Reference|*:Transforms|*:Transform|(Algorithm)")
Local $sXPath = $oResponseXml.GetChildContent("*:Body|cancelarLoteResponse|confirmaCancelamentoLote|*:Signature|*:SignedInfo|*:Reference|*:Transforms|*:Transform|*:XPath")
Local $sDigestMethod_Algorithm = $oResponseXml.ChilkatPath("*:Body|cancelarLoteResponse|confirmaCancelamentoLote|*:Signature|*:SignedInfo|*:Reference|*:DigestMethod|(Algorithm)")
Local $sDigestValue = $oResponseXml.GetChildContent("*:Body|cancelarLoteResponse|confirmaCancelamentoLote|*:Signature|*:SignedInfo|*:Reference|*:DigestValue")
Local $sSignatureValue = $oResponseXml.GetChildContent("*:Body|cancelarLoteResponse|confirmaCancelamentoLote|*:Signature|*:SignatureValue")
Local $sKeyInfo_Id = $oResponseXml.ChilkatPath("*:Body|cancelarLoteResponse|confirmaCancelamentoLote|*:Signature|*:KeyInfo|(Id)")
Local $sX509SubjectName = $oResponseXml.GetChildContent("*:Body|cancelarLoteResponse|confirmaCancelamentoLote|*:Signature|*:KeyInfo|*:X509Data|*:X509SubjectName")
Local $sX509Certificate = $oResponseXml.GetChildContent("*:Body|cancelarLoteResponse|confirmaCancelamentoLote|*:Signature|*:KeyInfo|*:X509Data|*:X509Certificate")
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>