SOAP WSDL Generate Code

wiswebserviceSoap / SendRequestC

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
integer li_rc
oleobject loo_Xml
string ls_SoapRequestBody
string ls_Endpoint
string ls_SoapAction
string ls_ContentType
oleobject loo_Http
oleobject loo_Resp
oleobject loo_ResponseXml
integer li_StatusCode
string ls_SendRequestCResult

loo_Xml = create oleobject
// Use "Chilkat_9_5_0.Xml" for versions of Chilkat < 10.0.0
li_rc = loo_Xml.ConnectToNewObject("Chilkat.Xml")
if li_rc < 0 then
    destroy loo_Xml
    MessageBox("Error","Connecting to COM object failed")
    return
end if
loo_Xml.Tag = "soapenv:Envelope"
loo_Xml.AddAttribute("xmlns:soapenv","http://schemas.xmlsoap.org/soap/envelope/")
loo_Xml.AddAttribute("xmlns:wis","http://www.wisinspections.com/")
loo_Xml.UpdateChildContent("soapenv:Header|wis:AuthenticateHeader|wis:Username","string")
loo_Xml.UpdateChildContent("soapenv:Header|wis:AuthenticateHeader|wis:Password","string")
loo_Xml.UpdateChildContent("soapenv:Body|wis:SendRequestC|wis:RequesterName","string")
loo_Xml.UpdateChildContent("soapenv:Body|wis:SendRequestC|wis:RequesterExt","string")
loo_Xml.UpdateChildContent("soapenv:Body|wis:SendRequestC|wis:RequesterEmail","string")
loo_Xml.UpdateChildContent("soapenv:Body|wis:SendRequestC|wis:ContractHolder","string")
loo_Xml.UpdateChildContent("soapenv:Body|wis:SendRequestC|wis:ContractSale","dateTime")
loo_Xml.UpdateChildContent("soapenv:Body|wis:SendRequestC|wis:ContractMileage","string")
loo_Xml.UpdateChildContent("soapenv:Body|wis:SendRequestC|wis:VehicleYear","string")
loo_Xml.UpdateChildContent("soapenv:Body|wis:SendRequestC|wis:VehicleMake","string")
loo_Xml.UpdateChildContent("soapenv:Body|wis:SendRequestC|wis:VehicleModel","string")
loo_Xml.UpdateChildContent("soapenv:Body|wis:SendRequestC|wis:Mileage","string")
loo_Xml.UpdateChildContent("soapenv:Body|wis:SendRequestC|wis:VinNo","string")
loo_Xml.UpdateChildContent("soapenv:Body|wis:SendRequestC|wis:ContractNo","string")
loo_Xml.UpdateChildContent("soapenv:Body|wis:SendRequestC|wis:AuthorizationNo","string")
loo_Xml.UpdateChildContent("soapenv:Body|wis:SendRequestC|wis:InspectionType","string")
loo_Xml.UpdateChildContent("soapenv:Body|wis:SendRequestC|wis:Concern1","string")
loo_Xml.UpdateChildContent("soapenv:Body|wis:SendRequestC|wis:Concern2","string")
loo_Xml.UpdateChildContent("soapenv:Body|wis:SendRequestC|wis:Concern3","string")
loo_Xml.UpdateChildContent("soapenv:Body|wis:SendRequestC|wis:Concern4","string")
loo_Xml.UpdateChildContent("soapenv:Body|wis:SendRequestC|wis:Concern5","string")
loo_Xml.UpdateChildContent("soapenv:Body|wis:SendRequestC|wis:Concern6","string")
loo_Xml.UpdateChildContent("soapenv:Body|wis:SendRequestC|wis:Concern7","string")
loo_Xml.UpdateChildContent("soapenv:Body|wis:SendRequestC|wis:Concern8","string")
loo_Xml.UpdateChildContent("soapenv:Body|wis:SendRequestC|wis:Concern9","string")
loo_Xml.UpdateChildContent("soapenv:Body|wis:SendRequestC|wis:Concern10","string")
loo_Xml.UpdateChildContent("soapenv:Body|wis:SendRequestC|wis:RepairSite","string")
loo_Xml.UpdateChildContent("soapenv:Body|wis:SendRequestC|wis:Address1","string")
loo_Xml.UpdateChildContent("soapenv:Body|wis:SendRequestC|wis:Address2","string")
loo_Xml.UpdateChildContent("soapenv:Body|wis:SendRequestC|wis:City","string")
loo_Xml.UpdateChildContent("soapenv:Body|wis:SendRequestC|wis:State","string")
loo_Xml.UpdateChildContent("soapenv:Body|wis:SendRequestC|wis:Zip","string")
loo_Xml.UpdateChildContent("soapenv:Body|wis:SendRequestC|wis:Phone","string")
loo_Xml.UpdateChildContent("soapenv:Body|wis:SendRequestC|wis:Contact","string")

// In a SOAP HTTP request, including the XML declaration (<?xml version="1.0" encoding="UTF-8"?>) in the XML body is generally not required. 
loo_Xml.EmitXmlDecl = 0
ls_SoapRequestBody = loo_Xml.GetXml()

ls_Endpoint = "http://www.wisinspections.com:8086/wiswebservice.asmx"
ls_SoapAction = "http://www.wisinspections.com/SendRequestC"
//  For SOAP requests, the standard Content-Type is usually set to "text/xml" or "application/soap+xml"
ls_ContentType = "text/xml"

loo_Http = create oleobject
// Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0
li_rc = loo_Http.ConnectToNewObject("Chilkat.Http")

loo_Http.ClearHeaders()
loo_Http.SetRequestHeader("Content-Type",ls_ContentType)
loo_Http.SetRequestHeader("SOAPAction",ls_SoapAction)

loo_Resp = loo_Http.PostXml(ls_Endpoint,ls_SoapRequestBody,"utf-8")
if loo_Http.LastMethodSuccess = 0 then
    Write-Debug loo_Http.LastErrorText
    Write-Debug "Failed to send SOAP request."
    destroy loo_Xml
    destroy loo_Http
    return
end if

// Get the XML response body.
loo_ResponseXml = create oleobject
// Use "Chilkat_9_5_0.Xml" for versions of Chilkat < 10.0.0
li_rc = loo_ResponseXml.ConnectToNewObject("Chilkat.Xml")

loo_Resp.GetBodyXml(loo_ResponseXml)

li_StatusCode = loo_Resp.StatusCode
Write-Debug "response status code: " + string(li_StatusCode)

destroy loo_Resp

// If the status code does not indicate succcess, then show the response XML,
// which probably contains error information.
if li_StatusCode <> 200 then
    Write-Debug loo_ResponseXml.GetXml()
    destroy loo_Xml
    destroy loo_Http
    destroy loo_ResponseXml
    return
end if

Write-Debug loo_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).

ls_SendRequestCResult = loo_ResponseXml.GetChildContent("*:Body|*:SendRequestCResponse|*:SendRequestCResult")


destroy loo_Xml
destroy loo_Http
destroy loo_ResponseXml
Request XML
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wis="http://www.wisinspections.com/">
    <soapenv:Header>
        <wis:AuthenticateHeader>
            <wis:Username>string</wis:Username>
            <wis:Password>string</wis:Password>
        </wis:AuthenticateHeader>
    </soapenv:Header>
    <soapenv:Body>
        <wis:SendRequestC>
            <wis:RequesterName>string</wis:RequesterName>
            <wis:RequesterExt>string</wis:RequesterExt>
            <wis:RequesterEmail>string</wis:RequesterEmail>
            <wis:ContractHolder>string</wis:ContractHolder>
            <wis:ContractSale>dateTime</wis:ContractSale>
            <wis:ContractMileage>string</wis:ContractMileage>
            <wis:VehicleYear>string</wis:VehicleYear>
            <wis:VehicleMake>string</wis:VehicleMake>
            <wis:VehicleModel>string</wis:VehicleModel>
            <wis:Mileage>string</wis:Mileage>
            <wis:VinNo>string</wis:VinNo>
            <wis:ContractNo>string</wis:ContractNo>
            <wis:AuthorizationNo>string</wis:AuthorizationNo>
            <wis:InspectionType>string</wis:InspectionType>
            <wis:Concern1>string</wis:Concern1>
            <wis:Concern2>string</wis:Concern2>
            <wis:Concern3>string</wis:Concern3>
            <wis:Concern4>string</wis:Concern4>
            <wis:Concern5>string</wis:Concern5>
            <wis:Concern6>string</wis:Concern6>
            <wis:Concern7>string</wis:Concern7>
            <wis:Concern8>string</wis:Concern8>
            <wis:Concern9>string</wis:Concern9>
            <wis:Concern10>string</wis:Concern10>
            <wis:RepairSite>string</wis:RepairSite>
            <wis:Address1>string</wis:Address1>
            <wis:Address2>string</wis:Address2>
            <wis:City>string</wis:City>
            <wis:State>string</wis:State>
            <wis:Zip>string</wis:Zip>
            <wis:Phone>string</wis:Phone>
            <wis:Contact>string</wis:Contact>
        </wis:SendRequestC>
    </soapenv:Body>
</soapenv:Envelope>
Response XML
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wis="http://www.wisinspections.com/">
    <soapenv:Header/>
    <soapenv:Body>
        <wis:SendRequestCResponse>
            <wis:SendRequestCResult>?</wis:SendRequestCResult>
        </wis:SendRequestCResponse>
    </soapenv:Body>
</soapenv:Envelope>