Tuesday, July 12, 2011

Crm 2011–Request Error in the OrganizationData.svc


I fought this error for an hour this afternoon.  I was setting the the URL to the OrganizationData.svc like so HTTP://CRMDEV-VPC:5555/XRMSERVICES/2011/ORGANIZATIONDATA.SVC/.  This always returned “Request Error” in blue bold letters followed by
The server encountered an error processing the request. See server logs for more details.
So I enabled tracing and retrieved the following from the trace log:
[2011-02-16 16:55:35.910] Process: w3wp |Organization:00000000-0000-0000-0000-000000000000 |Thread:    7 |Category: Platform.Sdk |User: 00000000-0000-0000-0000-000000000000 |Level: Error | ServiceModelTraceRedirector.TraceData
While this error may appear to be unhelpful, it really tells us  quite a bit.  Notice the Organization and the User are set to an empty GUID.  This is clearly an issue. Crm 2011’s OrganizationData.svc requires the Organization name be present in the the URL.  So the fix was quite simple, add the organization name to the URL:
Hope this saves someone some time.

3 comments:

Jamie Miley said...

You earned a follower on this post. I don't know enough about REST in CRM and it feels like the CRM implementation requires you to be calling the endpoint from the server. I could be wrong, but this seems to be the consensus. I haven't focused on it heavily for this reason.

mark said...

Thanks, this really save me some time.

jiminy gillickrs said...

Mad genius you are!