SOAP WSDL Generate Code

EProImportServiceSoap / DeleteTransaction

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_DeleteTransactionResult_MachineName
string ls_DeleteTransactionResult_StartTime
string ls_DeleteTransactionResult_EndTime
string ls_DeleteTransactionResult_Version
string ls_DeleteTransactionResult_TransactionID
string ls_DeleteTransactionResult_DocketsCreated
string ls_DeleteTransactionResult_ErrorEncountered
string ls_DeleteTransactionResult_DateTime
string ls_DeleteTransactionResult_RecordCount
string ls_DeleteTransactionResult_RecordsImported
string ls_DeleteTransactionResult_RecordsRejected
string ls_DeleteTransactionResult_TransactionDeleted
string ls_DeleteTransactionResult_User
string ls_DocketNumber
string ls_Message
string ls_ExtraInformation

loo_Xml = create oleobject
li_rc = loo_Xml.ConnectToNewObject("Chilkat_9_5_0.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:sch","urn:schemas-royalmail-com/webservice/epro")
loo_Xml.UpdateChildContent("soapenv:Header|sch:Authentication|sch:Username","string")
loo_Xml.UpdateChildContent("soapenv:Header|sch:Authentication|sch:Password","string")
loo_Xml.UpdateChildContentInt("soapenv:Header|sch:Authentication|sch:AccessCode",1042)
loo_Xml.UpdateChildContent("soapenv:Header|sch:Authentication|sch:Version","string")
loo_Xml.UpdateChildContent("soapenv:Header|sch:Authentication|sch:SecurityToken","string")
loo_Xml.UpdateChildContent("soapenv:Body|sch:DeleteTransaction|sch:TransactionId","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.epro.royalmail.com/WebServices/import/eproimport.asmx"
ls_SoapAction = "urn:schemas-royalmail-com/webservice/epro/DeleteTransaction"
//  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
li_rc = loo_Http.ConnectToNewObject("Chilkat_9_5_0.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
li_rc = loo_ResponseXml.ConnectToNewObject("Chilkat_9_5_0.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_DeleteTransactionResult_MachineName = loo_ResponseXml.ChilkatPath("*:Body|*:DeleteTransactionResponse|*:DeleteTransactionResult|(MachineName)")
ls_DeleteTransactionResult_StartTime = loo_ResponseXml.ChilkatPath("*:Body|*:DeleteTransactionResponse|*:DeleteTransactionResult|(StartTime)")
ls_DeleteTransactionResult_EndTime = loo_ResponseXml.ChilkatPath("*:Body|*:DeleteTransactionResponse|*:DeleteTransactionResult|(EndTime)")
ls_DeleteTransactionResult_Version = loo_ResponseXml.ChilkatPath("*:Body|*:DeleteTransactionResponse|*:DeleteTransactionResult|(Version)")
ls_DeleteTransactionResult_TransactionID = loo_ResponseXml.ChilkatPath("*:Body|*:DeleteTransactionResponse|*:DeleteTransactionResult|(TransactionID)")
ls_DeleteTransactionResult_DocketsCreated = loo_ResponseXml.ChilkatPath("*:Body|*:DeleteTransactionResponse|*:DeleteTransactionResult|(DocketsCreated)")
ls_DeleteTransactionResult_ErrorEncountered = loo_ResponseXml.ChilkatPath("*:Body|*:DeleteTransactionResponse|*:DeleteTransactionResult|(ErrorEncountered)")
ls_DeleteTransactionResult_DateTime = loo_ResponseXml.ChilkatPath("*:Body|*:DeleteTransactionResponse|*:DeleteTransactionResult|(DateTime)")
ls_DeleteTransactionResult_RecordCount = loo_ResponseXml.ChilkatPath("*:Body|*:DeleteTransactionResponse|*:DeleteTransactionResult|(RecordCount)")
ls_DeleteTransactionResult_RecordsImported = loo_ResponseXml.ChilkatPath("*:Body|*:DeleteTransactionResponse|*:DeleteTransactionResult|(RecordsImported)")
ls_DeleteTransactionResult_RecordsRejected = loo_ResponseXml.ChilkatPath("*:Body|*:DeleteTransactionResponse|*:DeleteTransactionResult|(RecordsRejected)")
ls_DeleteTransactionResult_TransactionDeleted = loo_ResponseXml.ChilkatPath("*:Body|*:DeleteTransactionResponse|*:DeleteTransactionResult|(TransactionDeleted)")
ls_DeleteTransactionResult_User = loo_ResponseXml.ChilkatPath("*:Body|*:DeleteTransactionResponse|*:DeleteTransactionResult|(User)")
ls_DocketNumber = loo_ResponseXml.GetChildContent("*:Body|*:DeleteTransactionResponse|*:DeleteTransactionResult|*:Dockets|*:Docket|*:DocketNumber")
ls_Message = loo_ResponseXml.GetChildContent("*:Body|*:DeleteTransactionResponse|*:DeleteTransactionResult|*:Errors|*:Error|*:Message")
ls_ExtraInformation = loo_ResponseXml.GetChildContent("*:Body|*:DeleteTransactionResponse|*:DeleteTransactionResult|*:Errors|*:Error|*:ExtraInformation")


destroy loo_Xml
destroy loo_Http
destroy loo_ResponseXml
Request XML
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sch="urn:schemas-royalmail-com/webservice/epro">
    <soapenv:Header>
        <sch:Authentication>
            <sch:Username>string</sch:Username>
            <sch:Password>string</sch:Password>
            <sch:AccessCode>1042</sch:AccessCode>
            <sch:Version>string</sch:Version>
            <sch:SecurityToken>string</sch:SecurityToken>
        </sch:Authentication>
    </soapenv:Header>
    <soapenv:Body>
        <sch:DeleteTransaction>
            <sch:TransactionId>string</sch:TransactionId>
        </sch:DeleteTransaction>
    </soapenv:Body>
</soapenv:Envelope>
Response XML
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sch="urn:schemas-royalmail-com/webservice/epro">
    <soapenv:Header/>
    <soapenv:Body>
        <sch:DeleteTransactionResponse>
            <sch:DeleteTransactionResult MachineName="?" StartTime="?" EndTime="?" Version="?" TransactionID="?" DocketsCreated="?" ErrorEncountered="?" DateTime="?" RecordCount="?" RecordsImported="?" RecordsRejected="?" TransactionDeleted="?" User="?">
                <sch:Dockets>
                    <sch:Docket>
                        <sch:DocketNumber>string</sch:DocketNumber>
                    </sch:Docket>
                </sch:Dockets>
                <sch:Errors>
                    <sch:Error>
                        <sch:Message>string</sch:Message>
                        <sch:ExtraInformation>string</sch:ExtraInformation>
                    </sch:Error>
                </sch:Errors>
            </sch:DeleteTransactionResult>
        </sch:DeleteTransactionResponse>
    </soapenv:Body>
</soapenv:Envelope>