加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

添加CrmService

发布时间:2020-12-17 02:01:11 所属栏目:安全 来源:网络整理
导读:第一次接触Crm,想通过调用WebService对实体进行访问,第一步就碰到难题了,获取CrmService对象一直不成功。因为对具体的参数涵义不了解,尝试花了不少时间。下面是自己的理解,最终尝试成功。 ? account newAccount = new account(); newAccount.name = "林

第一次接触Crm,想通过调用WebService对实体进行访问,第一步就碰到难题了,获取CrmService对象一直不成功。因为对具体的参数涵义不了解,尝试花了不少时间。下面是自己的理解,最终尝试成功。

?

account newAccount = new account();
newAccount.name = "林*成";
newAccount.accountnumber = "123456";
newAccount.address1_postalcode = "351001";
newAccount.address1_city = "Xiamen";
newAccount.telephone1 = "15860727***";
newAccount.websiteurl = "http://www.***.com/";

// Set up the CRM Service.
CrmAuthenticationToken token = new CrmAuthenticationToken();
token.AuthenticationType = 0;
token.OrganizationName = "crm";// 该名字为安装Crm4.0指定组织名称时填写的
????????????
CrmService service = new CrmService();
service.Url = "http://192.168.5.233/mscrmservices/2007/crmservice.asmx";// 这个必须写
service.CrmAuthenticationTokenValue = token;
service.Credentials = System.Net.CredentialCache.DefaultCredentials;

service.Create(newAccount);??

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读