SOAP WSDL Generate Code

DataServiceEndpointSoapBinding / getAllTypes

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
Chilkat.Xml xml = new Chilkat.Xml();
xml.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:getAllTypes|intf:vrid","xml");
xml.UpdateChildContent("soapenv:Body|intf:getAllTypes|intf:modelId","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.EmitXmlDecl = false;
string soapRequestBody = xml.GetXml();

string endpoint = "http://www.haynespro-services.com/workshopServices3/services/DataServiceEndpoint";
string soapAction = "";
//  For SOAP requests, the standard Content-Type is usually set to "text/xml" or "application/soap+xml"
string contentType = "text/xml";

Chilkat.Http http = new Chilkat.Http();

http.ClearHeaders();
http.SetRequestHeader("Content-Type",contentType);
http.SetRequestHeader("SOAPAction",soapAction);

Chilkat.HttpResponse resp = http.PostXml(endpoint,soapRequestBody,"utf-8");
if (http.LastMethodSuccess == false) {
    Debug.WriteLine(http.LastErrorText);
    Debug.WriteLine("Failed to send SOAP request.");
    return;
}

// Get the XML response body.
Chilkat.Xml responseXml = new Chilkat.Xml();
resp.GetBodyXml(responseXml);

int statusCode = resp.StatusCode;
Debug.WriteLine("response status code: " + Convert.ToString(statusCode));

// If the status code does not indicate succcess, then show the response XML,
// which probably contains error information.
if (statusCode != 200) {
    Debug.WriteLine(responseXml.GetXml());
    return;
}

Debug.WriteLine(responseXml.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).

string confirmationLink = responseXml.GetChildContent("*:Body|*:getAllTypesResponse|*:getAllTypesReturn|*:status|*:confirmationLink");
string statusCode = responseXml.GetChildContent("*:Body|*:getAllTypesResponse|*:getAllTypesReturn|*:status|*:statusCode");
string id = responseXml.GetChildContent("*:Body|*:getAllTypesResponse|*:getAllTypesReturn|*:typeArray|*:item|*:id");
string faultcodes = responseXml.GetChildContent("*:Body|*:getAllTypesResponse|*:getAllTypesReturn|*:typeArray|*:item|*:subjects|*:faultcodes");
string fusesandrelays = responseXml.GetChildContent("*:Body|*:getAllTypesResponse|*:getAllTypesReturn|*:typeArray|*:item|*:subjects|*:fusesandrelays");
string repairmanuals = responseXml.GetChildContent("*:Body|*:getAllTypesResponse|*:getAllTypesReturn|*:typeArray|*:item|*:subjects|*:repairmanuals");
string shownew = responseXml.GetChildContent("*:Body|*:getAllTypesResponse|*:getAllTypesReturn|*:typeArray|*:item|*:subjects|*:shownew");
string showoldabs = responseXml.GetChildContent("*:Body|*:getAllTypesResponse|*:getAllTypesReturn|*:typeArray|*:item|*:subjects|*:showoldabs");
string showoldmm = responseXml.GetChildContent("*:Body|*:getAllTypesResponse|*:getAllTypesReturn|*:typeArray|*:item|*:subjects|*:showoldmm");
string wiringdiagrams = responseXml.GetChildContent("*:Body|*:getAllTypesResponse|*:getAllTypesReturn|*:typeArray|*:item|*:subjects|*:wiringdiagrams");
string ty_end_year = responseXml.GetChildContent("*:Body|*:getAllTypesResponse|*:getAllTypesReturn|*:typeArray|*:item|*:ty_end_year");
string ty_engine_code = responseXml.GetChildContent("*:Body|*:getAllTypesResponse|*:getAllTypesReturn|*:typeArray|*:item|*:ty_engine_code");
string ty_model_id = responseXml.GetChildContent("*:Body|*:getAllTypesResponse|*:getAllTypesReturn|*:typeArray|*:item|*:ty_model_id");
string ty_name = responseXml.GetChildContent("*:Body|*:getAllTypesResponse|*:getAllTypesReturn|*:typeArray|*:item|*:ty_name");
string ty_power = responseXml.GetChildContent("*:Body|*:getAllTypesResponse|*:getAllTypesReturn|*:typeArray|*:item|*:ty_power");
string ty_start_year = responseXml.GetChildContent("*:Body|*:getAllTypesResponse|*:getAllTypesReturn|*:typeArray|*:item|*:ty_start_year");
string ty_used = responseXml.GetChildContent("*:Body|*:getAllTypesResponse|*:getAllTypesReturn|*:typeArray|*:item|*:ty_used");
string ty_volume = responseXml.GetChildContent("*:Body|*:getAllTypesResponse|*:getAllTypesReturn|*:typeArray|*:item|*:ty_volume");
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:getAllTypes>
            <intf:vrid>xml</intf:vrid>
            <intf:modelId>xml</intf:modelId>
        </intf:getAllTypes>
    </soapenv:Body>
</soapenv:Envelope>
Response XML
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tns2="http://datatypes.webservice.elecdata.vivid.nl" xmlns:tns1="http://datamodel.webservice.elecdata.vivid.nl" xmlns:intf="http://data.webservice.workshop.vivid.nl">
    <soapenv:Header/>
    <soapenv:Body>
        <intf:getAllTypesResponse>
            <intf:getAllTypesReturn>
                <tns1:status>
                    <intf:confirmationLink>xml</intf:confirmationLink>
                    <intf:statusCode>xml</intf:statusCode>
                </tns1:status>
                <tns1:typeArray>
                    <intf:item>
                        <tns2:id>xml</tns2:id>
                        <tns2:subjects>
                            <tns1:faultcodes>xml</tns1:faultcodes>
                            <tns1:fusesandrelays>xml</tns1:fusesandrelays>
                            <tns1:repairmanuals>xml</tns1:repairmanuals>
                            <tns1:shownew>xml</tns1:shownew>
                            <tns1:showoldabs>xml</tns1:showoldabs>
                            <tns1:showoldmm>xml</tns1:showoldmm>
                            <tns1:wiringdiagrams>xml</tns1:wiringdiagrams>
                        </tns2:subjects>
                        <tns2:ty_end_year>xml</tns2:ty_end_year>
                        <tns2:ty_engine_code>xml</tns2:ty_engine_code>
                        <tns2:ty_model_id>xml</tns2:ty_model_id>
                        <tns2:ty_name>xml</tns2:ty_name>
                        <tns2:ty_power>xml</tns2:ty_power>
                        <tns2:ty_start_year>xml</tns2:ty_start_year>
                        <tns2:ty_used>xml</tns2:ty_used>
                        <tns2:ty_volume>xml</tns2:ty_volume>
                    </intf:item>
                </tns1:typeArray>
            </intf:getAllTypesReturn>
        </intf:getAllTypesResponse>
    </soapenv:Body>
</soapenv:Envelope>