[英]What does it do when you add a service reference in Visual Studio, through the GUI?
I'm currently trying to call a WCF service dynamically See here , therefore, I'm trying to understand what happens behind, when I add a service reference by the GUI of Visual Studio... What's generated..? 目前,我想要动态调用WCF服务在这里看到 ,因此,我试图了解发生了什么后面,当我添加由Visual Studio的GUI服务引用...什么是生成..? An object is created and an implicit reference is created... 创建一个对象并创建一个隐式引用...
Are the references contained in a specific container, a sort of pool? 引用是否包含在特定的容器(一种池)中?
When you add a service reference, VS generates a proxy class for the service. 添加服务引用时,VS会为服务生成一个代理类。 This class implements the interface defined by your service endpoint as its ServiceContract, so it appears to consuming code as if it were the actual object performing the operations, but it contains and uses the communication channel defined by the endpoint and bindings to call the exposed service methods. 此类将服务端点定义的接口实现为其ServiceContract,因此看起来好像在消费代码,就像它是执行操作的实际对象一样,但是它包含并使用由端点定义的通信通道和绑定来调用公开的服务。方法。
If you do not have classes that conform to the signatures of the DataContracts required by the service, VS will generate those classes as well, but if you have already referenced classes that are marked identically to the DataContract (usually because you've referenced the project containing the DataContracts in the project with the client-side code) it will simply use those. 如果您没有符合服务要求的DataContracts签名的类,则VS也会生成这些类,但是如果您已经引用了与DataContract标记相同的类(通常是因为您已引用项目)包含带有客户端代码的项目中的DataContracts),它将仅使用这些代码。 Svcutil (the command-line tool) can be given a reference list of locations for these DataContracts as well. 也可以为Svcutil(命令行工具)提供这些DataContract的位置参考列表。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.