Hi,
I am new to MS Dynamics CRM and working on premises version,
Login is successful using PHP script but While creating a lead I am getting following error. I have tried to correct the time as per account but still getting the same same error.
Please let me know, In what cases this error comes and how to fix this issue
ERROR:
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing"><s:Header><a:Action s:mustUnderstand="1">http://www.w3.org/2005/08/addressing/soap/fault</a:Action><a:RelatesTo>urn:uuid:8bc5002c-658b-44ff-b79d-dd432b6f9675</a:RelatesTo></s:Header><s:Body><s:Fault><s:Code><s:Value>s:Sender</s:Value><s:Subcode><s:Value xmlns:a="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">a:InvalidSecurity</s:Value></s:Subcode></s:Code><s:Reason><s:Text xml:lang="en-US">An error occurred when verifying security for the message.</s:Text></s:Reason></s:Fault></s:Body></s:Envelope>
Thanks
*This post is locked for comments
Hi Amit, please check whether the client time and your server time is same. Server do not allow to access if ime difference is there. And if it is not the case then check your region. i.e.
crmna:dynamics.com - North America
crmemea:dynamics.com - Europe, the Middle East and Africa
crmapac:dynamics.com - Asia Pacific
regards,
Saroj
Thanks Saroj for your reply.
I already tried and confused with the time Zone.
I am getting the same error even after matching the time zone in my php script.
1. My Account time Zone is US/Eastern and same I set in my server with region crmna:dynamics.com
2. After login we get the time in UTC in response. I set the region crmemea:dynamics.com and time zone in UTC.
In both cases, Login in account is successful but while creating the lead I am getting the error.
Please Help where I am wrong.
Hi Amit, it seems like it might be authentication issue. Please follow the link.
blogs.msdn.com/.../connecting-to-crm-online-2011-web-services-using-soap-requests-only.aspx
hth
but I am not getting the authentication error otherwise it throw the error "LiveID not authenticated". It is during creating OR fetching records
Hi Amit, have you added your live Id in web.config. Please look into this. This might help.
crmbook.powerobjects.com/.../types-of-authentication
Thanks,
Yes, I added the ID and password which is domain specific.
Dynamic CRM is installed "on-premise".
Do you have any idea about PHP library for integration?
Hi Amit, i dont know PHP. But from the error it seems like it is related to security. Are you using SOAP end point and which version means 2007 or 2011. Please let me know.
It is 2011 and working with Dynamics 2011 online but it has issue with "On premise" version
Hi Amit, can you please provide your SOAP envelope code so that i can refer.
Can you please check the issue in following codes..
Request:
<s:Envelope xmlns:s="www.w3.org/.../soap-envelope"
xmlns:a="www.w3.org/.../addressing"
xmlns:u="docs.oasis-open.org/.../oasis-200401-wss-wssecurity-utility-1.0.xsd">
<s:Header>
<a:Action s:mustUnderstand="1">
schemas.microsoft.com/.../Create</a:Action>
<a:MessageID>
urn:uuid:7c2a16f2-9574-4446-a325-33e1cf7e3a16</a:MessageID>
<a:ReplyTo>
<a:Address>
www.w3.org/.../anonymous</a:Address>
</a:ReplyTo>
<VsDebuggerCausalityData xmlns="schemas.microsoft.com/.../servicemodelsink">
uIDPozJEz+P/wJdOhoN2XNauvYcAAAAAK0Y6fOjvMEqbgs9ivCmFPaZlxcAnCJ1GiX+Rpi09nSYACQAA</VsDebuggerCausalityData>
<a:To s:mustUnderstand="1">
xxx.xxxxxxxxxxxxxx.com/.../Organization.svc;/a:To>
<o:Security s:mustUnderstand="1"
xmlns:o="docs.oasis-open.org/.../oasis-200401-wss-wssecurity-secext-1.0.xsd">
<u:Timestamp u:Id="_0">
<u:Created>2014-11-26T06:23:19.00Z</u:Created>
<u:Expires>2014-11-27T06:23:19.00Z</u:Expires>
</u:Timestamp>
<EncryptedData Id="Assertion0"
Type="www.w3.org/.../xmlenc;
xmlns="www.w3.org/.../xmlenc;>
<EncryptionMethod Algorithm="www.w3.org/.../xmlenc;>
</EncryptionMethod>
<ds:KeyInfo xmlns:ds="www.w3.org/.../xmldsig;>
<EncryptedKey>
<ds:KeyInfo Id="keyinfo">
<wsse:SecurityTokenReference xmlns:wsse="docs.oasis-open.org/.../oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:KeyIdentifier EncodingType="docs.oasis-open.org/.../oasis-200401-wss-soap-message-security-1.0;
ValueType="docs.oasis-open.org/.../oasis-200401-wss-x509-token-profile-1.0;>
VrPTiMUGicDu5XJqdzD6SLXa8fY=</wsse:KeyIdentifier>
</wsse:SecurityTokenReference>
</ds:KeyInfo>
<CipherData>
<CipherValue>xxxxxxx xxxxxxxx xxxxxxxxx xxxxxxxxx</CipherValue>
</CipherData>
</EncryptedKey>
<CipherValue>xxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx</CipherValue>
</EncryptedData>
</o:Security>
</s:Header><s:Body>
<Create xmlns="schemas.microsoft.com/.../Services">
<entity xmlns:b="schemas.microsoft.com/.../Contracts" xmlns:i="www.w3.org/.../XMLSchema-instance">
<b:Attributes xmlns:c="schemas.datacontract.org/.../System.Collections.Generic"><b:KeyValuePairOfstringanyType><c:key>subject</c:key><c:value i:type="d:string" xmlns:d="www.w3.org/.../XMLSchema">xxxxx xx xxxxx</c:value></b:KeyValuePairOfstringanyType><b:KeyValuePairOfstringanyType><c:key>firstname</c:key><c:value i:type="d:string" xmlns:d="www.w3.org/.../XMLSchema">xxxx</c:value></b:KeyValuePairOfstringanyType><b:KeyValuePairOfstringanyType><c:key>emailaddress1</c:key><c:value i:type="d:string" xmlns:d="www.w3.org/.../XMLSchema">xxxx@xxxxx.com/c:value></b:KeyValuePairOfstringanyType><b:KeyValuePairOfstringanyType><c:key>leadsourcecode</c:key><c:value xmlns:b="schemas.microsoft.com/.../Contracts" i:type="b:OptionSetValue"><b:Value>8</b:Value></c:value></b:KeyValuePairOfstringanyType><b:KeyValuePairOfstringanyType><c:key>donotsendmm</c:key><c:value i:type="d:boolean" xmlns:d="www.w3.org/.../XMLSchema">1</c:value></b:KeyValuePairOfstringanyType><b:KeyValuePairOfstringanyType><c:key>description</c:key><c:value i:type="d:string" xmlns:d="www.w3.org/.../XMLSchema">xxxx xxxxx</c:value></b:KeyValuePairOfstringanyType></b:Attributes>
<b:EntityState i:nil="true"/>
<b:FormattedValues xmlns:c="schemas.datacontract.org/.../System.Collections.Generic"/>
<b:Id>00000000-0000-0000-0000-000000000000</b:Id>
<b:LogicalName>lead</b:LogicalName>
<b:RelatedEntities xmlns:c="schemas.datacontract.org/.../System.Collections.Generic"/>
</entity>
</Create>
</s:Body>
</s:Envelope>
<p>
</p>Response = <s:Envelope xmlns:s="www.w3.org/.../soap-envelope" xmlns:a="www.w3.org/.../addressing"><s:Header><a:Action s:mustUnderstand="1">www.w3.org/.../fault</a:Action><a:RelatesTo>urn:uuid:7c2a16f2-9574-4446-a325-33e1cf7e3a16</a:RelatesTo></s:Header><s:Body><s:Fault><s:Code><s:Value>s:Sender</s:Value><s:Subcode><s:Value xmlns:a="docs.oasis-open.org/.../oasis-200401-wss-wssecurity-secext-1.0.xsd">a:InvalidSecurity</s:Value></s:Subcode></s:Code><s:Reason><s:Text xml:lang="en-US">An error occurred when verifying security for the message.</s:Text></s:Reason></s:Fault></s:Body></s:Envelope><s:Text xml:lang="en-US">An error occurred when verifying security for the message.</s:Text>
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Community Member 2
HR-09070029-0 2
UllrSki 2