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.
thanks,
Rami Heleg,
NetusUp Inc.