Функция
GenerateAuthenticationHeader выглядит следующим образом:
X++:
var CRM2007_WEBSERVICE_NS = "http\x3a\x2f\x2fschemas.microsoft.com\x2fcrm\x2f2007\x2fWebServices";
var CRM2007_CORETYPES_NS = "http\x3a\x2f\x2fschemas.microsoft.com\x2fcrm\x2f2007\x2fCoreTypes";
function GenerateAuthenticationHeader()
{
var xml = new StringBuilder();
xml.Append("<soap:Header><CrmAuthenticationToken xmlns=\"");
xml.Append(CrmEncodeDecode.CrmXmlEncode(CRM2007_WEBSERVICE_NS));
xml.Append("\"><AuthenticationType xmlns=\"");
xml.Append(CrmEncodeDecode.CrmXmlEncode(CRM2007_CORETYPES_NS));
xml.Append("\">");
xml.Append(CrmEncodeDecode.CrmXmlEncode(AUTHENTICATION_TYPE));
xml.Append("</AuthenticationType><CrmTicket xmlns=\"");
xml.Append(CrmEncodeDecode.CrmXmlEncode(CRM2007_CORETYPES_NS));
xml.Append("\"></CrmTicket><OrganizationName xmlns=\"");
xml.Append(CrmEncodeDecode.CrmXmlEncode(CRM2007_CORETYPES_NS));
xml.Append("\">");
xml.Append(CrmEncodeDecode.CrmXmlEncode(ORG_UNIQUE_NAME));
xml.Append("</OrganizationName><CallerId xmlns=\"");
xml.Append(CrmEncodeDecode.CrmXmlEncode(CRM2007_CORETYPES_NS));
xml.Append("\">00000000-0000-0000-0000-000000000000</CallerId></CrmAuthenticationToken></soap:Header>");
return xml.ToString();
}
AUTHENTICATION_TYPE для IFD = 2, ORG_UNIQUE_NAME - имя вашей