web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Getting error for SOAP request "InvalidSecurity : An error occurred when verifying security for the message."

(0) ShareShare
ReportReport
Posted on by

Hi,

I am working on MS Dynamics CRM 2016 integration using SOAP. I was trying to execute WHOAMI request but getting InvalidSecurity error with NTLM authenticaion via SOAP UI.
InvalidSecurity : An error occurred when verifying security for the message.

Please find my soap request snippet here:

POST xxxxxxxx/.../Organization.svc

<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa10="http://www.w3.org/2005/08/addressing">
<env:Header>

<wsa10:Action env:mustUnderstand="1">schemas.microsoft.com/.../Execute&lt;/wsa10:Action>
</env:Header>
<env:Body>
<Execute xmlns="schemas.microsoft.com/.../Services" xmlns:xsi="www.w3.org/.../XMLSchema-instance">
<request xsi:type="crmtns:WhoAmIRequest" xmlns:crmtns="schemas.microsoft.com/.../Contracts" xmlns:xrmtns="schemas.microsoft.com/.../Contracts">
<xrmtns:Parameters xmlns:scg="schemas.datacontract.org/.../System.Collections.Generic"/>
<xrmtns:RequestId xsi:nil="true"/>
<xrmtns:RequestName>WhoAmI</xrmtns:RequestName>
</request>
</Execute>
</env:Body>
</env:Envelope>
Content-Type: application/soap+xml;charset=utf-8
Accept: application/soap+xml

Am I missing something here? 

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Subhash Mahato Profile Picture
    358 on at

    hi

    Please try this request shown below.

    you need to use below show code to get the who am i request.

    HTTP REQUEST
    --------------------------------------------------
    POST https://<yourorganizationName>.api.crm5.dynamics.com/XRMServices/2011/Organization.svc/web
    Content-Type: text/xml; charset=utf-8
    SOAPAction: http://schemas.microsoft.com/xrm/2011/Contracts/Services/IOrganizationService/Execute
    
    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    <s:Body>
    <Execute xmlns="http://schemas.microsoft.com/xrm/2011/Contracts/Services" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
    <request i:type="b:WhoAmIRequest" xmlns:a="http://schemas.microsoft.com/xrm/2011/Contracts" xmlns:b="http://schemas.microsoft.com/crm/2011/Contracts">
    <a:Parameters xmlns:c="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
    <a:RequestId i:nil="true" />
    <a:RequestName>WhoAmI</a:RequestName>
    </request>
    </Execute>
    </s:Body>
    </s:Envelope>
    --------------------------------------------------
    below is shoap response
    HTTP RESPONSE -------------------------------------------------- <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body> <ExecuteResponse xmlns="http://schemas.microsoft.com/xrm/2011/Contracts/Services" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <ExecuteResult i:type="b:WhoAmIResponse" xmlns:a="http://schemas.microsoft.com/xrm/2011/Contracts" xmlns:b="http://schemas.microsoft.com/crm/2011/Contracts"> <a:ResponseName>WhoAmI</a:ResponseName> <a:Results xmlns:c="http://schemas.datacontract.org/2004/07/System.Collections.Generic"> <a:KeyValuePairOfstringanyType> <c:key>UserId</c:key> <c:value i:type="d:guid" xmlns:d="http://schemas.microsoft.com/2003/10/Serialization/">e2437844-0674-e211-9df5-1cc1de6e4b9c</c:value> </a:KeyValuePairOfstringanyType> <a:KeyValuePairOfstringanyType> <c:key>BusinessUnitId</c:key> <c:value i:type="d:guid" xmlns:d="http://schemas.microsoft.com/2003/10/Serialization/">89d4ef2f-97f4-e411-80fd-c4346bada39c</c:value> </a:KeyValuePairOfstringanyType> <a:KeyValuePairOfstringanyType> <c:key>OrganizationId</c:key> <c:value i:type="d:guid" xmlns:d="http://schemas.microsoft.com/2003/10/Serialization/">d5280326-1baa-40b9-af5c-f799cf3ec61d</c:value> </a:KeyValuePairOfstringanyType> </a:Results> </ExecuteResult> </ExecuteResponse> </s:Body> </s:Envelope> --------------------------------------------------

    hope this helps

    Thanks & regards 

    Subhash Mahato

  • Community Member Profile Picture
    on at

    hi Subhash,

    Thanks for the reply.

    Yes, your request is also correct but I believe you are using Soap 1.1 and you are appending '/web' with URL and SOAPAction is part of request header.

    But I would like to execute these request using SOAP 1.2 which has some different syntax.

    www.herongyang.com/.../Perl-SOAP-1-2-Request-Differences-SOAP-1-1-and-1-2.html

    Could you also let me know when to use '/web' and its purpose?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans