








昨天差点郁闷死,两次写Blog都是在最后窗口关掉了.
第一次是鼠标问题,单击经常变双击,在Maxthon的标签栏切换的时候关了,Alt+Z也没能挽回.
罗技鼠里也有垃圾,还300+大洋的...
第二次是看别的网页弹出个窗口,点了个"否",Maxthon就关了...
【总结】世界是未知的,不可预测的,变幻莫测的.
做事情要一心一意,备份总是有好处的.
OK, Let's go to the first sample!
以IIS6.0为宿主,ASP.NET为客户端进行演示.
服务器端
Ⅰ.在IIS中新建一个站点,命名为:WCF_AX. 端口设为:1212.You have created a service.
To test this service, you will need to create a client and use it to call the service. You can do this using the svcutil.exe tool from the command line with the following syntax:
svcutil.exe http://*****:1212/Service1.svc?wsdl
This will generate a configuration file and a code file that contains the client class. Add the two files to your client application and use the generated client class to call the Service. For example:
客户端
Ⅰ.打开VS2008,新建一个Website.命名为:WebSite_AX
protected void Page_Load(object sender, EventArgs e)
{
//创建一个Service1的代理
ServiceReference1.IService1 service = new ServiceReference1.Service1Client();
//使用代理
Response.Write(service.GetData(1212));
}
Ⅴ.F5运行.
如出现打开页面显示:【You entered: 1212 】,说明服务调用成功!
少帮主的斧头好久不饮血了!
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。