Answered by:
Metadata contains a reference that cannot be resolved: 'http://rajeevmaithani.crm5.dynamics.com/XRMServices/2011/Organization.svc?wsdl'.

Question
-
Hello All,
I am trying to create a Account record in MS CRM 2011 cloud using webservices. While creating the Organizationserviceproxy using the discovery service application through's the error message as "Metadata contains a reference that cannot be resolved: 'http://xyz.crm5.dynamics.com/XRMServices/2011/Organization.svc?wsdl'."
Placed the code below:
ICrmService _service = new ICrmService();
ClientCredentials Credentials = new ClientCredentials();
Credentials.UserName.UserName = "xyz@XYZ.COM";
Credentials.UserName.Password = "XXXXX";
//This URL needs to be updated to match the servername and Organization for the environment.
Uri OrganizationUri = new Uri("http://xyz.crm5.dynamics.com/XRMServices/2011/Organization.svc");
Uri HomeRealmUri = null;
//OrganizationServiceProxy serviceProxy;
using (OrganizationServiceProxy serviceProxy = new OrganizationServiceProxy(OrganizationUri, HomeRealmUri, Credentials, null)){
//Create account code
}Friday, August 17, 2012 10:37 AM
Answers
-
I tried several ways still i am facing the same issue. Please help me how to proceed further on this.
- Marked as answer by R.A.Kumar Friday, October 12, 2012 1:37 PM
Friday, October 12, 2012 1:34 PM
All replies
-
Make sure you are entering the URL right.
Go to Settings -> Developer Resources -> Organization Service
i.e.
https://xyz.api.crm5.dynamics.com/XRMServices/2011/Organization.svc
And also check for device credentials.
I hope this helps. If my response answered your question, please mark the response as an answer and also vote as helpful.
Mubasher Sharif
Check out my about.me profile!
http://mubashersharif.blogspot.com
Linked-In Profile
Follow me on Twitter!
- Edited by MubasherSharif Friday, August 17, 2012 10:53 AM
Friday, August 17, 2012 10:51 AM -
Hello Sharif,
Thanks for your reply.
I can access the http://xyz.crm5.dynamics.com/XRMServices/2011/Organization.svc url from IE, but while using in code its giving the error.
As i checked in Settings -> Developer Resources -> Organization Service is the same url which i specified on above.
Thanks
Anjaneya
Friday, August 17, 2012 11:17 AM -
Hello Sharif,
Sorry i updated the correct Organization url from Settings -> Developer Resources -> Organization Service and tried to create a record. Still the same issue.
Thanks
Kumar
Friday, August 17, 2012 11:31 AM -
When working online you will need to pass in Device Credentials as the fourth parameter to the OragnizationServiceProxy. Try using the deviceidmanager class in the helpercode in the sdk.
Kirsten
Friday, August 17, 2012 11:35 AM -
I am glad that you correct the organization url
And what about device credentials?
Did you generate and pass it
here is my code that works fine for me
Uri organizationUri;
Uri homeRealmUri;
ClientCredentials credentials = new ClientCredentials();
ClientCredentials deviceCredentials = new ClientCredentials();
public string GenerateLead(string _userName, string _userEmail, string _userMessage)
{
try { credentials.UserName.UserName = "username"; credentials.UserName.Password = "password"; deviceCredentials.UserName.UserName = "Device user name"; deviceCredentials.UserName.Password = "Device Password"; organizationUri = new Uri("organization url"); homeRealmUri = null; using (OrganizationServiceProxy serviceProxy = new OrganizationServiceProxy(organizationUri, homeRealmUri, credentials, deviceCredentials)) { IOrganizationService service = (IOrganizationService)serviceProxy; Entity lead = new Entity("lead"); lead["lastname"] = _userName; lead["emailaddress1"] = _userEmail; lead["subject"] = _userMessage; service.Create(lead); } return "Complete"; } catch (System.Exception excep) { return "error"; }
}
I hope this helps. If my response answered your question, please mark the response as an answer and also vote as helpful.
Mubasher Sharif
Check out my about.me profile!
http://mubashersharif.blogspot.com
Linked-In Profile
Follow me on Twitter!
- Edited by MubasherSharif Friday, August 17, 2012 11:39 AM
- Proposed as answer by MubasherSharif Friday, August 17, 2012 12:20 PM
Friday, August 17, 2012 11:38 AM -
Hi Kumar,
I faced this issue many times. Can you please just try by replacing 'http' to 'https' and see if it works.
Thanks,
Thanks and regards,
Hiren Solanki.
Please vote or mark as a answer if it helped you.Friday, August 17, 2012 11:52 AM -
AOA Mubashir,
Hope you are in best of health. I am new in Dynamics CRM online. I get a 30 days trial from CRM onlie and download SDK. I am trying to run sample code of SDK from last many days but unable to make connection with server. Please help me in this regard. Please provide me some code to connect to CRM online 365 server.
i have following information regarding CRM
https://portal.microsoftonline.com/admin/default.asp
user: ali.akbar@tstcomp.onmicrosoft.com
password: Karmanwala1
Ali Akbar
Monday, August 27, 2012 12:32 PM -
I tried several ways still i am facing the same issue. Please help me how to proceed further on this.
- Marked as answer by R.A.Kumar Friday, October 12, 2012 1:37 PM
Friday, October 12, 2012 1:34 PM -
Hi R.A.Kumar,
Does this issue got resolved for you?
Regards, Raghu
Wednesday, September 17, 2014 2:59 AM