"SilverlightApplication.ServiceReference1"是一个“命名空间",但其用法类似于“类型" [英] 'SilverlightApplication.ServiceReference1' is a 'namespace' but is used like a 'type'

查看:69
本文介绍了"SilverlightApplication.ServiceReference1"是一个“命名空间",但其用法类似于“类型"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Silverlight教程:使用DataGrid,LINQ和WCF Web服务创建以数据为中心的Web应用程序 [ ^ ]


在本文中,我不知道什么是DemoServiceClient

Silverlight Tutorial: Creating a data centric web app with DataGrid, LINQ, and WCF Web Service[^]


At this Article What is DemoServiceClient i dont know

private void OnSubmitBtnClick(object sender, RoutedEventArgs e)<br />
{<br />
    DemoServiceClient webService = new DemoServiceClient();<br />
<br />
    webService.InsertDataAsync(TestItem1TxtBox.Text, TestItem2TxtBox.Text);<br />
}





请帮助我.





Please help me.

推荐答案

这似乎是Web服务的代理.但是,在文章中发布此问题后,作者也许可以进一步指导您.
That appears to be the proxy to the webservice. However post this question in the article and the author might be able to guide you further.


这是用于通信WebServer的Web服务代理参考类:)
That is the Web Service Proxy reference Class for Communicating the WebServer :)


您好,

DemoServiceClient是添加服务引用时由Visual Studio IDE生成的代理.

假设您有一个名为"MyService"的WCF服务,并将服务引用添加到了项目中,它将在该项目中生成代理类,以使您可以轻松访问服务合同.

然后,您可以使用以下方法来调用类中的方法,即服务调用:

Hi,

DemoServiceClient is the proxy generated by the Visual Studio IDE when you are adding the service reference.

Suppose, you have a WCF service named "MyService" and you added the service reference to your project, it will generate the proxy class in that project to give you easy access to the service contract.

You can then call the methods inside the class i.e. the service call by using this:

DemoServiceClient webService = new DemoServiceClient();<br />
...<br />
...<br />
webService.InsertDataAsync(TestItem1TxtBox.Text, TestItem2TxtBox.Text); // assume this is the service call


这篇关于"SilverlightApplication.ServiceReference1"是一个“命名空间",但其用法类似于“类型"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆