SOAP Services

Help page:

The SOAPHeader Element

The SOAP Header element contains application-specific information(like authentication) about the SOAP message. If the Header element is present, it must be the first element in the Envelope element.
Note: All immediate Child elements of the header element must be namespace-qualified

<s:Envelope xmlns:s="">
    <Action s:mustUnderstand="1" xmlns=""></Action>
      <h:AuthHeader xmlns="" xmlns:xsi="" xmlns:xsd="" xmlns:h="">
        <Date>Tue, 12 Aug 2014 14:18:50 GMT</Date>
 <s:Body xmlns:xsi="" xmlns:xsd="">
<GetReports xmlns="">

The mustUnderstand Attribute

The SOAP mustUnderstand attribute can be used to indicate whether a header entry is mandatory or optional for the recipient to process. It is mandatory to send a SOAPHeader to the WCF service.
If you add mustUnderstand="1" to a child element of the Header element, it indicates that the receiver processing the Header must recognize the element. If the receiver does not recognize the element, it will fail when processing the Header.



The AuthHeader is required to authenticate the login to the WCF web server. It is contained in the SoapHeader element for every request.

AuthHeader Schema
<xs:schema xmlns:xs="" xmlns="" xmlns:xsi="" elementFormDefault="qualified" targetNamespace="">
<xs:element name="AuthHeader">
<xs:element name="Authorization" type="xs:string"/>
<xs:element name="Date" type="xs:string"/>

Auth Header Elements
Element Definition Required
Authorization Y
Date Y

Creating AuthHeader
public AuthHeader AuthHeader
	AuthHeader header = null;
	if (!string.IsNullOrEmpty(APIKey))
	  header = new AuthHeader(); 
	  header.Date = DateTime.UtcNow.ToString(HEADER_TIMESTAMP_FORMAT); header.Authorization = APIKey; 
	  throw new PCMilerException("Could not generate AuthHeader. Not all values have been defined."); 
	return header;

The Request Elements


Represents header information that is part of every web service request.

<xs:complexType name="RequestHeader">
<xs:element minOccurs="0" name="DataVersion" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="RequestType" nillable="true" type="xs:string"/>
<xs:element name="RequestHeader" nillable="true" type="tns:RequestHeader"/>

RequestHeader Elements
Element Definition Required
DataVersion String value. The data version can be any version number ranging from 18 through 26. Use "LastQuarter" for last quarter data, "current for current quarter data and baseline for releasequarter data." N
RequestType String value. The AboutService API requires this to be "AboutMapService". All other API's do not validate this and can be any string. N


ResponseHeader Elements
Element Definition
DataVersion A string. Gets or sets the data version used in the request operation.
Errors A list of Errors object<>. Gets or sets a collection of errors that may have occurred during the request operation.
Success A boolean value. Gets or sets the response type which is the same value that the user passed in for the request.
Type A string. Gets or sets the response type which is the same value that the user passed in for the request type.
Error Members
Element Definition
Code An enumeration of PcmwsExceptionCode. Gets or sets the data version used in the request operation.

Usage: var errCode = new ServiceReference.PcmwsExceptionCode();

errorCode = response.Header.Errors[0].Code;

Description A string. Gets or sets the detailed error description.

Usage: var description = response.Header.Errors[0].Description;.
LegacyErrorCode An Integer. Gets or sets the legacy error code which is an integer valued code that would have been returned in PCMiler Web Services V25 and earlier.

Usage: int Xresponse.Header.Errors[0].legacyErrorCode;
Type Gets or sets whether the error is an exception or a warning.

Usage: string type = response.Header.Errors[0].type;