GenerateAuthenticationHeader Function
![]() |
[Applies to: Microsoft Dynamics CRM 4.0]
Find the latest SDK documentation: CRM 2015 SDK
Returns a string that represents a correctly formed Microsoft Dynamics CRM authentication header used when making Web service calls with Microsoft Dynamics CRM Web services. This is the <soap:Header> part of an XMLHttp request.
Usage
GenerateAuthenticationHeader()
Parameters
None
Returns
A String value that contains the authentication header.
Remarks
This authentication header automatically determines the appropriate authentication type to use for each deployment type: on-premise, Internet-facing deployment (IFD), or Microsoft Dynamics CRM Online. For more information, see Accessing Microsoft Dynamics CRM Web Services.
Example
var soapBody = "<soap:Body>"+ "<Execute xmlns='http://schemas.microsoft.com/crm/2007/"+ "WebServices'>"+ "<Request xsi:type='WhoAmIRequest' />"+ "</Execute></soap:Body>"; var soapXml = "<soap:Envelope " + "xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' "+ "xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' "+ "xmlns:xsd='http://www.w3.org/2001/XMLSchema'>"; soapXml += GenerateAuthenticationHeader(); soapXml += soapBody; soapXml += "</soap:Envelope>";
See Also
Concepts
Other Resources
© 2010 Microsoft Corporation. All rights reserved.
