SOAP WSDL Generate Code

UslugiUBDSoap / WyslijDokumentZbiorczy

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 = "soap:Envelope"
$oXml.AddAttribute("xmlns:ubd","http://www.mf.gov.pl/uslugiBiznesowe/DI/UslugiUBD/2013/11/05")
$oXml.AddAttribute("xmlns:soap","http://www.w3.org/2003/05/soap-envelope")
$oXml.AddAttribute("xmlns:a05","http://www.mf.gov.pl/schematy/DI/UslugiUBD/2013/11/05")
$oXml.UpdateChildContent "soap:Header",""
$oXml.UpdateChildContent "soap:Body|a05:WyslijDokumentZbiorczyPytanie|a05:Dokument","BqozVXeZZg=="
$oXml.UpdateChildContent "soap:Body|a05:WyslijDokumentZbiorczyPytanie|a05:Jezyk","de"

; 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://test-ubd.mf.gov.pl/uslugi/dokumenty"
Local $soapAction = "urn:WyslijDokumentZbiorczy"
;  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 $sRefId = $oResponseXml.GetChildContent("*:Body|*:WyslijDokumentZbiorczyOdpowiedz|*:refId")
Local $iStatus = $oResponseXml.GetChildIntValue("*:Body|*:WyslijDokumentZbiorczyOdpowiedz|*:status")
Local $statusOpis = $oResponseXml.GetChildContent("*:Body|*:WyslijDokumentZbiorczyOdpowiedz|*:statusOpis")
Request XML
<soap:Envelope xmlns:ubd="http://www.mf.gov.pl/uslugiBiznesowe/DI/UslugiUBD/2013/11/05" xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:a05="http://www.mf.gov.pl/schematy/DI/UslugiUBD/2013/11/05">
    <soap:Header/>
    <soap:Body>
        <a05:WyslijDokumentZbiorczyPytanie>
            <a05:Dokument>BqozVXeZZg==</a05:Dokument>
            <a05:Jezyk>de</a05:Jezyk>
        </a05:WyslijDokumentZbiorczyPytanie>
    </soap:Body>
</soap:Envelope>
Response XML
<soap:Envelope xmlns:ubd="http://www.mf.gov.pl/uslugiBiznesowe/DI/UslugiUBD/2013/11/05" xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:a05="http://www.mf.gov.pl/schematy/DI/UslugiUBD/2013/11/05">
    <soap:Header/>
    <soap:Body>
        <a05:WyslijDokumentZbiorczyOdpowiedz>
            <a05:refId>string</a05:refId>
            <a05:status>1042</a05:status>
            <a05:statusOpis>string</a05:statusOpis>
        </a05:WyslijDokumentZbiorczyOdpowiedz>
    </soap:Body>
</soap:Envelope>