require 'chilkat'
xml = Chilkat::CkXml.new()
xml.put_Tag("soapenv:Envelope")
xml.AddAttribute("xmlns:intf","http://data.webservice.workshop.vivid.nl")
xml.AddAttribute("xmlns:soapenv","http://schemas.xmlsoap.org/soap/envelope/")
xml.UpdateChildContent("soapenv:Header","")
xml.UpdateChildContent("soapenv:Body|intf:decodeVINV4|intf:vrid","xml")
xml.UpdateChildContent("soapenv:Body|intf:decodeVINV4|intf:descriptionLanguage","xml")
xml.UpdateChildContent("soapenv:Body|intf:decodeVINV4|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.
xml.put_EmitXmlDecl(false)
soapRequestBody = xml.getXml()
endpoint = "http://www.haynespro-services.com/workshopServices3/services/DataServiceEndpoint"
soapAction = ""# For SOAP requests, the standard Content-Type is usually set to "text/xml" or "application/soap+xml"
contentType = "text/xml"
http = Chilkat::CkHttp.new()
http.ClearHeaders()
http.SetRequestHeader("Content-Type",contentType)
http.SetRequestHeader("SOAPAction",soapAction)
# resp is a CkHttpResponse
resp = http.PostXml(endpoint,soapRequestBody,"utf-8")
if (http.get_LastMethodSuccess() == false)
print http.lastErrorText() + "\n";
print"Failed to send SOAP request." + "\n";
exitend# Get the XML response body.
responseXml = Chilkat::CkXml.new()
resp.GetBodyXml(responseXml)
statusCode = resp.get_StatusCode()
print"response status code: " + statusCode.to_s() + "\n";
# If the status code does not indicate succcess, then show the response XML,
# which probably contains error information.if (statusCode != 200)
print responseXml.getXml() + "\n";
exitendprint responseXml.getXml() + "\n";
# 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).
capacity = responseXml.getChildContent("*:Body|*:decodeVINV4Response|*:decodeVINV4Return|*:capacity")
engineCode = responseXml.getChildContent("*:Body|*:decodeVINV4Response|*:decodeVINV4Return|*:engineCode")
item = responseXml.getChildContent("*:Body|*:decodeVINV4Response|*:decodeVINV4Return|*:etkSuggestions|*:item|*:eggImplementationCodes|*:item")
eggVarCode = responseXml.getChildContent("*:Body|*:decodeVINV4Response|*:decodeVINV4Return|*:etkSuggestions|*:item|*:eggVarCode")
fuelType = responseXml.getChildContent("*:Body|*:decodeVINV4Response|*:decodeVINV4Return|*:fuelType")
fullName = responseXml.getChildContent("*:Body|*:decodeVINV4Response|*:decodeVINV4Return|*:fullName")
id = responseXml.getChildContent("*:Body|*:decodeVINV4Response|*:decodeVINV4Return|*:id")
level = responseXml.getChildContent("*:Body|*:decodeVINV4Response|*:decodeVINV4Return|*:level")
madeFrom = responseXml.getChildContent("*:Body|*:decodeVINV4Response|*:decodeVINV4Return|*:madeFrom")
madeUntil = responseXml.getChildContent("*:Body|*:decodeVINV4Response|*:decodeVINV4Return|*:madeUntil")
modelPictureMimeDataName = responseXml.getChildContent("*:Body|*:decodeVINV4Response|*:decodeVINV4Return|*:modelPictureMimeDataName")
name = responseXml.getChildContent("*:Body|*:decodeVINV4Response|*:decodeVINV4Return|*:name")
order = responseXml.getChildContent("*:Body|*:decodeVINV4Response|*:decodeVINV4Return|*:order")
output = responseXml.getChildContent("*:Body|*:decodeVINV4Response|*:decodeVINV4Return|*:output")
remark = responseXml.getChildContent("*:Body|*:decodeVINV4Response|*:decodeVINV4Return|*:remark")
madeFrom = responseXml.getChildContent("*:Body|*:decodeVINV4Response|*:decodeVINV4Return|*:repairTimeTypes|*:item|*:madeFrom")
madeUntil = responseXml.getChildContent("*:Body|*:decodeVINV4Response|*:decodeVINV4Return|*:repairTimeTypes|*:item|*:madeUntil")
make = responseXml.getChildContent("*:Body|*:decodeVINV4Response|*:decodeVINV4Return|*:repairTimeTypes|*:item|*:make")
model = responseXml.getChildContent("*:Body|*:decodeVINV4Response|*:decodeVINV4Return|*:repairTimeTypes|*:item|*:model")
item = responseXml.getChildContent("*:Body|*:decodeVINV4Response|*:decodeVINV4Return|*:repairTimeTypes|*:item|*:motnrs|*:item")
output = responseXml.getChildContent("*:Body|*:decodeVINV4Response|*:decodeVINV4Return|*:repairTimeTypes|*:item|*:output")
repairtimeTypeId = responseXml.getChildContent("*:Body|*:decodeVINV4Response|*:decodeVINV4Return|*:repairTimeTypes|*:item|*:repairtimeTypeId")
rootNodeId = responseXml.getChildContent("*:Body|*:decodeVINV4Response|*:decodeVINV4Return|*:repairTimeTypes|*:item|*:rootNodeId")
confirmationLink = responseXml.getChildContent("*:Body|*:decodeVINV4Response|*:decodeVINV4Return|*:repairTimeTypes|*:item|*:status|*:confirmationLink")
statusCode = responseXml.getChildContent("*:Body|*:decodeVINV4Response|*:decodeVINV4Return|*:repairTimeTypes|*:item|*:status|*:statusCode")
v_type = responseXml.getChildContent("*:Body|*:decodeVINV4Response|*:decodeVINV4Return|*:repairTimeTypes|*:item|*:type")
typeCategory = responseXml.getChildContent("*:Body|*:decodeVINV4Response|*:decodeVINV4Return|*:repairTimeTypes|*:item|*:typeCategory")
confirmationLink = responseXml.getChildContent("*:Body|*:decodeVINV4Response|*:decodeVINV4Return|*:status|*:confirmationLink")
statusCode = responseXml.getChildContent("*:Body|*:decodeVINV4Response|*:decodeVINV4Return|*:status|*:statusCode")
item = responseXml.getChildContent("*:Body|*:decodeVINV4Response|*:decodeVINV4Return|*:subjects|*:item")
key = responseXml.getChildContent("*:Body|*:decodeVINV4Response|*:decodeVINV4Return|*:subjectsByGroup|*:mapItems|*:item|*:key")
value = responseXml.getChildContent("*:Body|*:decodeVINV4Response|*:decodeVINV4Return|*:subjectsByGroup|*:mapItems|*:item|*:value")
superCarTypeId = responseXml.getChildContent("*:Body|*:decodeVINV4Response|*:decodeVINV4Return|*:superCarTypeId")