Header

 

Code Examples

SOAP (XML)

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing"
xmlns:b="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:data="urn:hisoftware:compliancesheriff:data"
xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:inst="http://www.w3.org/2001/XMLSchema-instance"
xmlns:urn="urn:hisoftware:compliancesheriff:services">
    <env:Header xmlns="urn:hisoftware:compliancesheriff:data">
        <a:Action           soap:mustUnderstand="1">urn:hisoftware:compliancesheriff:services/Operations/CreateScan</a:Action>
        <ApiKey>22DF0959F20743660304CB829B3891F0</ApiKey>
        <a:MessageID>urn:uuid:d7451282-26e6-4000-8829-ce2febf529f9</a:MessageID>
        <a:ReplyTo>
            <a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address>
        </a:ReplyTo>
<a:To soap:mustUnderstand="1">http://localhost/ComplianceSheriff/OperationsService.svc</a:To>
    </env:Header>
    <env:Body>
        <!--BodyContents-->
    </env:Body>
</soap:Envelope>

 

C#

OperationsService opClient = new OperationsService();
using (OperationContextScope scope = new OperationContextScope(opClient.InnerChannel))
{
    // Add API Key to header
    MessageHeader header = MessageHeader.CreateHeader(
        "ApiKey",
        "urn:hisoftware:compliancesheriff:data",
        apiKey
    );
    OperationContext.Current.OutgoingMessageHeaders.Add(header);

    // Run method
    opClient.IsScanRunning("2000");

    // Done with service.
    opClient.Close();
}

 

Java

final String replyToAddress = "http://www.w3.org/2005/08/addressing/anonymous";
final EndpointReference replyTopnt = new EndpointReference(replyToAddress);
ServiceClient serviceClient = opClient._getServiceClient();

// Set endpoint for the api calls
serviceClient.setTargetEPR(endpnt);

// Turn on the addressing module.
// Required to add the ReplyTo and MessageID and Action header items
serviceClient.engageModule("addressing");

// Setup header info
serviceClient.getOptions().setReplyTo(replyTopnt);
serviceClient.addStringHeader((new QName("urn:hisoftware:compliancesheriff:data",
"ApiKey")), apiKey);