如何从另一个WCF调用WCF [英] how to call WCF from another WCF

查看:79
本文介绍了如何从另一个WCF调用WCF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个WCF服务(WCF1和WCF2)。 WCF2生成了一些功能。 WCF1必须根据某些条件调用WCF2。我在WCF1中添加了WCF2服务引用。

为WCF2创建对象并调用方法,



WCF2.WCF2Client etObj = new WCF2Client();

etObj.EmployeeInterfaced();





在构建时我收到错误WCF2



WCF1.IWCF1类型中不存在类型名称WCF2



请帮助我

I have two WCF service(WCF1 and WCF2). WCF2 generates does some function. WCF1 has to call WCF2 on basis of some condition. I added the WCF2 service reference in WCF1.
Created object for the WCF2 and called the method,

WCF2.WCF2Client etObj = new WCF2Client();
etObj.EmployeeInterfaced();


On build i get the error WCF2

The type name 'WCF2' does not exist in the type 'WCF1.IWCF1'

Please help me

推荐答案

检查您的目标框架是否具有相同的.NET版本。所有项目的目标框架都是相同的。它应该可以正常工作。
Check to see that your target framework has the same .NET versions.Set the "Target Framework" of all the projects to be the same. It should work fine.


确保包含所有服务引用。
Make sure all service references are included.


这篇关于如何从另一个WCF调用WCF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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