【发布时间】:2010-11-15 13:06:36
【问题描述】:
我有一个这样的WCF服务服务场景
命名空间 Company.BO.Contracts {
public interface ITypeService { }
public partial interface IType1Services : ITypeService
{
[OperationContract()]
Type1 GetType1(System.Int32 idValue);
[OperationContract()]
Type1 Save(Type1 myType1, System.Int32 changeUser);
}
public partial interface IType2Services : ITypeService
{
[OperationContract()]
Type2 GetType2(System.Int32 idValue);
[OperationContract()]
Type2 Save(Type2 type2, System.Int32 changeUser);
}
}
命名空间 Company.ContractFulfillment {
public class Type1Services : IType1Services
{
public MyType1 GetType1(System.Int32 idValue)
{
return new Type1();
}
}
public class Type2Services : IType2Services
{
public Type2 GetType2(System.Int32 idValue)
{
return new Type2();
}
}
}
当我将上述代码公开为 WCF 服务时,BizTalk 无法区分 Type1.Save() 和 Type2.Save()。有没有办法不修改服务,因为服务是框架的一部分,需要在其他依赖位置进行更多更改?
对于 BizTalk 以外的客户端,服务访问层被包装到类型库(type1、type2 等)中,客户端访问此类型库作为普通类库。
【问题讨论】:
-
您说“BizTalk 无法区分 Type1.Save() 和 Type2.Save()”时,您能更具体地说明您的意思吗?另外,如果您尝试使用 WCF 客户端(“添加服务引用”)使用它会发生什么?