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
LOCAL loXml
LOCAL lcSoapRequestBody
LOCAL lcEndpoint
LOCAL lcSoapAction
LOCAL lcContentType
LOCAL loHttp
LOCAL loResp
LOCAL loResponseXml
LOCAL lnStatusCode
LOCAL lcCapacity
LOCAL lcEngineCode
LOCAL lcFuelType
LOCAL lcFullName
LOCAL lcId
LOCAL lcLevel
LOCAL lcMadeFrom
LOCAL lcMadeUntil
LOCAL lcModelPictureMimeDataName
LOCAL lcName
LOCAL lcOrder
LOCAL lcOutput
LOCAL lcRemark
LOCAL lcConfirmationLink
LOCAL lcStatusCode
LOCAL lcItem
LOCAL lcKey
LOCAL lcValue
LOCAL lcSuperCarTypeId

loXml = CreateObject('Chilkat_9_5_0.Xml')
loXml.Tag = "soapenv:Envelope"
loXml.AddAttribute("xmlns:intf","http://data.webservice.workshop.vivid.nl")
loXml.AddAttribute("xmlns:soapenv","http://schemas.xmlsoap.org/soap/envelope/")
loXml.UpdateChildContent("soapenv:Header","")
loXml.UpdateChildContent("soapenv:Body|intf:decodeVIN|intf:vrid","xml")
loXml.UpdateChildContent("soapenv:Body|intf:decodeVIN|intf:descriptionLanguage","xml")
loXml.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. 
loXml.EmitXmlDecl = 0
lcSoapRequestBody = loXml.GetXml()

lcEndpoint = "http://www.haynespro-services.com/workshopServices3/services/DataServiceEndpoint"
lcSoapAction = ""
*  For SOAP requests, the standard Content-Type is usually set to "text/xml" or "application/soap+xml"
lcContentType = "text/xml"

loHttp = CreateObject('Chilkat_9_5_0.Http')

loHttp.ClearHeaders()
loHttp.SetRequestHeader("Content-Type",lcContentType)
loHttp.SetRequestHeader("SOAPAction",lcSoapAction)

loResp = loHttp.PostXml(lcEndpoint,lcSoapRequestBody,"utf-8")
IF (loHttp.LastMethodSuccess = 0) THEN
    ? loHttp.LastErrorText
    ? "Failed to send SOAP request."
    RELEASE loXml
    RELEASE loHttp
    CANCEL
ENDIF

* Get the XML response body.
loResponseXml = CreateObject('Chilkat_9_5_0.Xml')
loResp.GetBodyXml(loResponseXml)

lnStatusCode = loResp.StatusCode
? "response status code: " + STR(lnStatusCode)

RELEASE loResp

* If the status code does not indicate succcess, then show the response XML,
* which probably contains error information.
IF (lnStatusCode <> 200) THEN
    ? loResponseXml.GetXml()
    RELEASE loXml
    RELEASE loHttp
    RELEASE loResponseXml
    CANCEL
ENDIF

? loResponseXml.GetXml()

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

lcCapacity = loResponseXml.GetChildContent("*:Body|*:decodeVINResponse|*:decodeVINReturn|*:capacity")
lcEngineCode = loResponseXml.GetChildContent("*:Body|*:decodeVINResponse|*:decodeVINReturn|*:engineCode")
lcFuelType = loResponseXml.GetChildContent("*:Body|*:decodeVINResponse|*:decodeVINReturn|*:fuelType")
lcFullName = loResponseXml.GetChildContent("*:Body|*:decodeVINResponse|*:decodeVINReturn|*:fullName")
lcId = loResponseXml.GetChildContent("*:Body|*:decodeVINResponse|*:decodeVINReturn|*:id")
lcLevel = loResponseXml.GetChildContent("*:Body|*:decodeVINResponse|*:decodeVINReturn|*:level")
lcMadeFrom = loResponseXml.GetChildContent("*:Body|*:decodeVINResponse|*:decodeVINReturn|*:madeFrom")
lcMadeUntil = loResponseXml.GetChildContent("*:Body|*:decodeVINResponse|*:decodeVINReturn|*:madeUntil")
lcModelPictureMimeDataName = loResponseXml.GetChildContent("*:Body|*:decodeVINResponse|*:decodeVINReturn|*:modelPictureMimeDataName")
lcName = loResponseXml.GetChildContent("*:Body|*:decodeVINResponse|*:decodeVINReturn|*:name")
lcOrder = loResponseXml.GetChildContent("*:Body|*:decodeVINResponse|*:decodeVINReturn|*:order")
lcOutput = loResponseXml.GetChildContent("*:Body|*:decodeVINResponse|*:decodeVINReturn|*:output")
lcRemark = loResponseXml.GetChildContent("*:Body|*:decodeVINResponse|*:decodeVINReturn|*:remark")
lcConfirmationLink = loResponseXml.GetChildContent("*:Body|*:decodeVINResponse|*:decodeVINReturn|*:status|*:confirmationLink")
lcStatusCode = loResponseXml.GetChildContent("*:Body|*:decodeVINResponse|*:decodeVINReturn|*:status|*:statusCode")
lcItem = loResponseXml.GetChildContent("*:Body|*:decodeVINResponse|*:decodeVINReturn|*:subjects|*:item")
lcKey = loResponseXml.GetChildContent("*:Body|*:decodeVINResponse|*:decodeVINReturn|*:subjectsByGroup|*:mapItems|*:item|*:key")
lcValue = loResponseXml.GetChildContent("*:Body|*:decodeVINResponse|*:decodeVINReturn|*:subjectsByGroup|*:mapItems|*:item|*:value")
lcSuperCarTypeId = loResponseXml.GetChildContent("*:Body|*:decodeVINResponse|*:decodeVINReturn|*:superCarTypeId")

RELEASE loXml
RELEASE loHttp
RELEASE loResponseXml

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>