SOAP WSDL Generate Code

DataServiceEndpointSoapBinding / decodeVIN

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:intf","http://data.webservice.workshop.vivid.nl")
$oXml.AddAttribute("xmlns:soapenv","http://schemas.xmlsoap.org/soap/envelope/")
$oXml.UpdateChildContent "soapenv:Header",""
$oXml.UpdateChildContent "soapenv:Body|intf:decodeVIN|intf:vrid","xml"
$oXml.UpdateChildContent "soapenv:Body|intf:decodeVIN|intf:descriptionLanguage","xml"
$oXml.UpdateChildContent "soapenv:Body|intf:decodeVIN|intf:vin","xml"

; 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 = "http://www.haynespro-services.com/workshopServices3/services/DataServiceEndpoint"
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 $sCapacity = $oResponseXml.GetChildContent("*:Body|*:decodeVINResponse|*:decodeVINReturn|*:capacity")
Local $sEngineCode = $oResponseXml.GetChildContent("*:Body|*:decodeVINResponse|*:decodeVINReturn|*:engineCode")
Local $sFuelType = $oResponseXml.GetChildContent("*:Body|*:decodeVINResponse|*:decodeVINReturn|*:fuelType")
Local $sFullName = $oResponseXml.GetChildContent("*:Body|*:decodeVINResponse|*:decodeVINReturn|*:fullName")
Local $sId = $oResponseXml.GetChildContent("*:Body|*:decodeVINResponse|*:decodeVINReturn|*:id")
Local $sLevel = $oResponseXml.GetChildContent("*:Body|*:decodeVINResponse|*:decodeVINReturn|*:level")
Local $sMadeFrom = $oResponseXml.GetChildContent("*:Body|*:decodeVINResponse|*:decodeVINReturn|*:madeFrom")
Local $sMadeUntil = $oResponseXml.GetChildContent("*:Body|*:decodeVINResponse|*:decodeVINReturn|*:madeUntil")
Local $sModelPictureMimeDataName = $oResponseXml.GetChildContent("*:Body|*:decodeVINResponse|*:decodeVINReturn|*:modelPictureMimeDataName")
Local $sName = $oResponseXml.GetChildContent("*:Body|*:decodeVINResponse|*:decodeVINReturn|*:name")
Local $sOrder = $oResponseXml.GetChildContent("*:Body|*:decodeVINResponse|*:decodeVINReturn|*:order")
Local $sOutput = $oResponseXml.GetChildContent("*:Body|*:decodeVINResponse|*:decodeVINReturn|*:output")
Local $sRemark = $oResponseXml.GetChildContent("*:Body|*:decodeVINResponse|*:decodeVINReturn|*:remark")
Local $sConfirmationLink = $oResponseXml.GetChildContent("*:Body|*:decodeVINResponse|*:decodeVINReturn|*:status|*:confirmationLink")
Local $statusCode = $oResponseXml.GetChildContent("*:Body|*:decodeVINResponse|*:decodeVINReturn|*:status|*:statusCode")
Local $sItem = $oResponseXml.GetChildContent("*:Body|*:decodeVINResponse|*:decodeVINReturn|*:subjects|*:item")
Local $sKey = $oResponseXml.GetChildContent("*:Body|*:decodeVINResponse|*:decodeVINReturn|*:subjectsByGroup|*:mapItems|*:item|*:key")
Local $sValue = $oResponseXml.GetChildContent("*:Body|*:decodeVINResponse|*:decodeVINReturn|*:subjectsByGroup|*:mapItems|*:item|*:value")
Local $superCarTypeId = $oResponseXml.GetChildContent("*:Body|*:decodeVINResponse|*:decodeVINReturn|*:superCarTypeId")
Request XML
<soapenv:Envelope xmlns:intf="http://data.webservice.workshop.vivid.nl" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Header/>
    <soapenv:Body>
        <intf:decodeVIN>
            <intf:vrid>xml</intf:vrid>
            <intf:descriptionLanguage>xml</intf:descriptionLanguage>
            <intf:vin>xml</intf:vin>
        </intf:decodeVIN>
    </soapenv:Body>
</soapenv:Envelope>
Response XML
<soapenv:Envelope xmlns:intf="http://data.webservice.workshop.vivid.nl" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Header/>
    <soapenv:Body>
        <intf:decodeVINResponse>
            <intf:decodeVINReturn>
                <intf:capacity>xml</intf:capacity>
                <intf:engineCode>xml</intf:engineCode>
                <intf:fuelType>xml</intf:fuelType>
                <intf:fullName>xml</intf:fullName>
                <intf:id>xml</intf:id>
                <intf:level>xml</intf:level>
                <intf:madeFrom>xml</intf:madeFrom>
                <intf:madeUntil>xml</intf:madeUntil>
                <intf:modelPictureMimeDataName>xml</intf:modelPictureMimeDataName>
                <intf:name>xml</intf:name>
                <intf:order>xml</intf:order>
                <intf:output>xml</intf:output>
                <intf:remark>xml</intf:remark>
                <intf:status>
                    <intf:confirmationLink>xml</intf:confirmationLink>
                    <intf:statusCode>xml</intf:statusCode>
                </intf:status>
                <intf:subjects>
                    <intf:item>xml</intf:item>
                </intf:subjects>
                <intf:subjectsByGroup>
                    <intf:mapItems>
                        <intf:item>
                            <intf:key>xml</intf:key>
                            <intf:value>xml</intf:value>
                        </intf:item>
                    </intf:mapItems>
                </intf:subjectsByGroup>
                <intf:superCarTypeId>xml</intf:superCarTypeId>
            </intf:decodeVINReturn>
        </intf:decodeVINResponse>
    </soapenv:Body>
</soapenv:Envelope>