Reputation: 39118
I'm moving out some of the code from a plugin to an external web application. The only thing that needs to be added is the authorization. When executing my QueryExpression instance from within the plugin, that's not an issue. However, accessing the date from outside is. :)
I'm not sure where to provide the credentials (user name and password) so the endpoint at my CRM organization lets me in.
I prefer to resolve it in such a way so I can create a web service reference and work towards it directly. So, the (kind of) requirement is not to go using and creating proxy.
How can I do that?!
Here's the very basic scenario I'd like to effectuate. I've created a web service reference in VS using the wizard (endpoint address is Organization.svc).
QueryExpression request = new QueryExpression
{
EntityName = "account",
ColumnSet = new ColumnSet()
};
OrganizationServiceClient client = new OrganizationServiceClient();
IEnumerable<Entity> response = client.RetrieveMultiple(request).Entities;
int entityCount = response.Count();
Upvotes: 0
Views: 1070
Reputation: 5446
I would suggest no to use Reference but to use SDK assemblies. Recheck following article - http://msdn.microsoft.com/en-us/library/gg695790.aspx
Also Recheck this article - http://nishantrana.wordpress.com/2012/12/06/sample-code-to-connect-office-365-users-to-crm-2011-online/ and http://nishantrana.wordpress.com/2010/11/03/sample-code-for-using-iorganizationservice-in-crm-2011/
Upvotes: 1