If we put it in a method;
public static CrmService getCrmWebService(string _serverName, string _orgName) { CrmAuthenticationToken token = new CrmAuthenticationToken(); token.AuthenticationType = 0; token.OrganizationName = _orgName; CrmService _service = new CrmService(); _service.Url = "http://" + _serverName + "/mscrmservices/2007/crmservice.asmx"; _service.CrmAuthenticationTokenValue = token; NetworkCredential _cred = new NetworkCredential(); _cred.Domain = "CRMBIZDOMAIN"; _cred.UserName = "CRM_ADMIN_01"; _cred.Password = "F1xit@OR5"; _service.Credentials = _cred; return _service; }
Calling part;
CrmService _CrmService = CrmCore.getCrmWebService("corp-biz01:5555", "AxCRM01");
Now any operation is possible.
To check how to do the same thing in CRM 2011, click here.
No comments:
Post a Comment