Thursday, August 16, 2012

Connecting to CRM online Office 365 From webresource Utility

I was trying to connect to the office 365 env via the webresource utility tool provided in the SDK.

I was getting the error that MetaData Cannot be resolved and i noticed that the URL is pointing to https://dev.orgname.crm.dynamics.com/XRMServices/2011/Discovery.svc

but when i see the actual url for the discovery service in the developer resources section of the customization then its a different url

https://disco.orgname.crm.dynamics.com/XRMServices/2011/Discovery.svc

So to resolve this issue i had to make a minor change in the code for the webresource utility tool. 

Open the webresource utility solution and in the DataAccess folder open ConsolelessServerConnection.cs

locate the method with the below signature
public virtual ServerConnection.Configuration GetServerConfiguration(string server, string orgName, string user, string pw, string domain )

and change  config.DiscoveryUri =
new Uri(String.Format("https://dev.{0}/XRMServices/2011/Discovery.svc", config.ServerAddress));

to

config.DiscoveryUri =
new Uri(String.Format("https://disco.{0}/XRMServices/2011/Discovery.svc", config.ServerAddress));

This will resolve the issue.

We might have to go the same change for other tools also. so just incase if you face similar issue then you can try this