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
#import <CkoXml.h>
#import <NSString.h>
#import <CkoHttp.h>
#import <CkoHttpResponse.h>

CkoXml *xml = [[CkoXml alloc] init];
xml.Tag = @"soapenv:Envelope";
[xml AddAttribute: @"xmlns:soapenv" value: @"http://schemas.xmlsoap.org/soap/envelope/"];
[xml AddAttribute: @"xmlns:sch" value: @"urn:schemas-royalmail-com/webservice/epro"];
[xml UpdateChildContent: @"soapenv:Header|sch:Authentication|sch:Username" value: @"string"];
[xml UpdateChildContent: @"soapenv:Header|sch:Authentication|sch:Password" value: @"string"];
[xml UpdateChildContentInt: @"soapenv:Header|sch:Authentication|sch:AccessCode" value: [NSNumber numberWithInt: 1042]];
[xml UpdateChildContent: @"soapenv:Header|sch:Authentication|sch:Version" value: @"string"];
[xml UpdateChildContent: @"soapenv:Header|sch:Authentication|sch:SecurityToken" value: @"string"];
[xml UpdateChildContent: @"soapenv:Body|sch:DeleteTransaction|sch:TransactionId" value: @"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. 
xml.EmitXmlDecl = NO;
NSString *soapRequestBody = [xml GetXml];

NSString *endpoint = @"http://www.epro.royalmail.com/WebServices/import/eproimport.asmx";
NSString *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"
NSString *contentType = @"text/xml";

CkoHttp *http = [[CkoHttp alloc] init];

[http ClearHeaders];
[http SetRequestHeader: @"Content-Type" value: contentType];
[http SetRequestHeader: @"SOAPAction" value: soapAction];

CkoHttpResponse *resp = [http PostXml: endpoint xmlDoc: soapRequestBody charset: @"utf-8"];
if (http.LastMethodSuccess == NO) {
    NSLog(@"%@",http.LastErrorText);
    NSLog(@"%@",@"Failed to send SOAP request.");
    return;
}

// Get the XML response body.
CkoXml *responseXml = [[CkoXml alloc] init];
[resp GetBodyXml: responseXml];

int statusCode = [resp.StatusCode intValue];
NSLog(@"%@%d",@"response status code: ",statusCode);

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

NSLog(@"%@",[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).

NSString *DeleteTransactionResult_MachineName = [responseXml ChilkatPath: @"*:Body|*:DeleteTransactionResponse|*:DeleteTransactionResult|(MachineName)"];
NSString *DeleteTransactionResult_StartTime = [responseXml ChilkatPath: @"*:Body|*:DeleteTransactionResponse|*:DeleteTransactionResult|(StartTime)"];
NSString *DeleteTransactionResult_EndTime = [responseXml ChilkatPath: @"*:Body|*:DeleteTransactionResponse|*:DeleteTransactionResult|(EndTime)"];
NSString *DeleteTransactionResult_Version = [responseXml ChilkatPath: @"*:Body|*:DeleteTransactionResponse|*:DeleteTransactionResult|(Version)"];
NSString *DeleteTransactionResult_TransactionID = [responseXml ChilkatPath: @"*:Body|*:DeleteTransactionResponse|*:DeleteTransactionResult|(TransactionID)"];
NSString *DeleteTransactionResult_DocketsCreated = [responseXml ChilkatPath: @"*:Body|*:DeleteTransactionResponse|*:DeleteTransactionResult|(DocketsCreated)"];
NSString *DeleteTransactionResult_ErrorEncountered = [responseXml ChilkatPath: @"*:Body|*:DeleteTransactionResponse|*:DeleteTransactionResult|(ErrorEncountered)"];
NSString *DeleteTransactionResult_DateTime = [responseXml ChilkatPath: @"*:Body|*:DeleteTransactionResponse|*:DeleteTransactionResult|(DateTime)"];
NSString *DeleteTransactionResult_RecordCount = [responseXml ChilkatPath: @"*:Body|*:DeleteTransactionResponse|*:DeleteTransactionResult|(RecordCount)"];
NSString *DeleteTransactionResult_RecordsImported = [responseXml ChilkatPath: @"*:Body|*:DeleteTransactionResponse|*:DeleteTransactionResult|(RecordsImported)"];
NSString *DeleteTransactionResult_RecordsRejected = [responseXml ChilkatPath: @"*:Body|*:DeleteTransactionResponse|*:DeleteTransactionResult|(RecordsRejected)"];
NSString *DeleteTransactionResult_TransactionDeleted = [responseXml ChilkatPath: @"*:Body|*:DeleteTransactionResponse|*:DeleteTransactionResult|(TransactionDeleted)"];
NSString *DeleteTransactionResult_User = [responseXml ChilkatPath: @"*:Body|*:DeleteTransactionResponse|*:DeleteTransactionResult|(User)"];
NSString *DocketNumber = [responseXml GetChildContent: @"*:Body|*:DeleteTransactionResponse|*:DeleteTransactionResult|*:Dockets|*:Docket|*:DocketNumber"];
NSString *Message = [responseXml GetChildContent: @"*:Body|*:DeleteTransactionResponse|*:DeleteTransactionResult|*:Errors|*:Error|*:Message"];
NSString *ExtraInformation = [responseXml GetChildContent: @"*:Body|*:DeleteTransactionResponse|*:DeleteTransactionResult|*:Errors|*:Error|*:ExtraInformation"];
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>