Create CrmService with Caller Id

by Rami Heleg

Here is the example to create CrmService: CrmAuthenticationToken token = new CrmAuthenticationToken();

token.OrganizationName = “org1”;

token.AuthenticationType = 0; //Active directory token.CallerId = userGuid; // impersonate to this user CrmService pService = new CrmService();

pService.Url = _strServerUrl + “/MSCRMServices/2007/crmservice.asmx”;

pService.CrmAuthenticationTokenValue = token; pService.Credentials = DefaultCredential();

i can create crmService from two type

1. CrmService as web service from mscrmservices\2007

2. Microsoft.Crm.SDK. to change the callerid i failed to do it if i used Crmservice from webservice. i test the issue and changing the caller works only if Crmservice from type Microsoft.Crm.Sdk.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: