Dynamics CRM 2011编程系列(48): WCF Service 和 Web Service 程序的部署
来源:互联网 发布:mac装机必备 编辑:程序博客网 时间:2024/06/06 08:30
很多时候我们需要自己发布自己的API给外部程序进行调用,这时候就需要用到WCF或Web Service了。我们来看个简单的例子吧:
Web Service
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.Services;/// <summary>/// Summary description for WebService/// </summary>[WebService(Namespace = "http://tempuri.org/")][WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. // [System.Web.Script.Services.ScriptService]public class WebService : System.Web.Services.WebService { public WebService () { //Uncomment the following line if using designed components //InitializeComponent(); } [WebMethod] public string HelloWorld() { return "Hello World"; } }
WCF Service
using System;using System.Collections.Generic;using System.Linq;using System.Runtime.Serialization;using System.ServiceModel;using System.ServiceModel.Activation;using System.Text;// NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service" in code, svc and config file together.[AspNetCompatibilityRequirements(RequirementsMode=AspNetCompatibilityRequirementsMode.Allowed)]public class Service : IService{public void DoWork(){}}
部署步骤
图1
图2
图3
图4
图5
图6
图7
小结
1.WCF Service 必须放在XrmServices文件夹下,放在其他的位置会出错。具体原因不明
2.WCF Service 和 Web Service 并不一定需要部署在Dynamics CRM 系统的安装目录下,毕竟它们是用来解决异构系统的产品。
- Dynamics CRM 2011编程系列(48): WCF Service 和 Web Service 程序的部署
- Dynamics CRM 2011 编程系列(22):用插件调用Web Service
- Dynamics CRM 2011 编程系列(23):用插件调用WCF
- Dynamics CRM 2011编程系列(43):JavaScript 的调试
- Dynamics CRM 2011编程系列
- Dynamics CRM 2011编程系列
- Dynamics CRM 2011编程系列(55):Dynamics CRM 集成开发简述
- wcf和web service的区别
- Web Service和WCF的关系
- WCF 、Web API 、 WCF REST 和 Web Service 的区别
- WCF、 Web API、 WCF REST 和 Web Service 的区别
- WCF 、Web API 、 WCF REST 和 Web Service 的区别
- WCF ,Web API , WCF REST 和 Web Service 的区别
- Dynamics CRM 2011 编程系列(25):插件的依赖注入
- Dynamics CRM 2011编程系列(39):Ribbon Button + GhostHook
- Dynamics CRM 2011编程系列(49):FetchExpression(一)
- Dynamics CRM 2011编程系列(54):MagicBox实现原理
- Dynamics CRM 2011 编程系列(16):插件
- 【解决方案】Vmware安装时出现的"already installed"错误
- STK应用没有显示
- MySql报错: You can't specify target table 'table name' for update in FROM clause
- linux 目录介绍
- Android Camera 架构简析1
- Dynamics CRM 2011编程系列(48): WCF Service 和 Web Service 程序的部署
- Project facet Java version 1.7 is not supported
- shell字符串的截取
- Android Camera 架构简析2
- 自定义DateField
- 神经网络与支持向量机
- source insight调用Keil编译器并且定位到错误行
- BugFix 2:状态栏显示耳机插拔图标
- MR21批量修改价格