Asked by:
MS CRM 2011 AD web service authentication using Soap issue

Question
-
Hi,
May i know how do we authenticate to MS CRM 2011 web services?
I am using Lotus script to do the web services which is similar to VB script language.
I was using the 2007 end point URL and now i want to switch to the 2011 web services (XRM Services).
WebServiceURL = CRMURL+"/XRMServices/2011/Organization.svc/web"SOAPAction = "http://schemas.microsoft.com/xrm/2011/Contracts/Services/IOrganizationService/Execute"
Set objXMLHTTP = CreateObject("MSXML2.ServerXMLHTTP.6.0")
Call objXMLHTTP.open ("POST", WebServiceURL , False,UserName,Password)
Call objXMLHTTP.setRequestHeader("Content-Type", "text/xml; charset=utf-8" )
Call objXMLHTTP.setRequestHeader("SOAPAction", SOAPAction)
call objXMLHTTP.send(WebServiceRequest)The above code is used to authenticate with the 2007 end point URL and is working fine, But it is not working for the 2011 URL.
I am getting the Authentication failed Response as shown below when i tried the 'WhoAmI' request
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><s:Fault><faultcode xmlns:a="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-
1.0.xsd">a:FailedAuthentication</faultcode><faultstring xml:lang="en-US">Access is denied.</faultstring></s:Fault></s:Body></s:Envelope>
I guess the username and Password should set in some other way for crm 2011?
Can anyone help me?
Thanks
Prasanth
Wednesday, September 11, 2013 6:44 AM
All replies
-
As you are not adding this as a web resource in CRM and it isn't a C# app your best bet is to look at this reference http://msdn.microsoft.com/en-us/library/gg327838.aspx.
More then likely you cannot use the /web on your service url as this is for internal webresources accessing CRM services.
This also describes the /web limitation/internal auth feature. http://msdn.microsoft.com/en-us/library/gg490657.aspx
MS CRM Bing'd - http://bingsoft.wordpress.com Dynamics XRM Tools CRM 4 to CRM 2011 JavaScript Converter Tool CRM 2011 OData Query Designer CRM 2011 Metadata Browser CRM Forum Guidance Wednesday, September 11, 2013 3:40 PMModerator -
You can also refer to the below for a sample
http://blog.customereffective.com/blog/2011/05/execute-fetch-from-javascript-in-crm-2011.html
If my response helps you in finding your answer then please click 'Mark as Answer' and 'Vote as Helpful'
Wednesday, September 11, 2013 5:03 PM -
Thanks to both of you for the Reply.
I thought web services using external Soap Application can be done only by using the /web part and i saw the same in some blogs.
In regards to the authentication issue, Some one told me you can try to not authenticate at all. The Dynamics CRM is a single sign on application so the windows platform is handling authentication for you.
we need non windows user to authenticate with CRM using our application as well , In that Case we have to authenticate with CRM with a specific username and password.
That's where we are stuck.
He also mentioned to authenticate with 2011 AD, you have to use the WCF Service. I don't have an Idea about the WCF service.
Do you know whether is that something that can be done using SOAP/XML request and authenticate with CRM?
Thursday, September 12, 2013 1:33 PM