0

I have a .NET WCF service which exposes an object that uses polymorphism.

Apparantly, Websphere Integration Developer is unable to handle this properly (I am not the Websphere developer), except by adding all fields of all possible polymorphisms and using a enum or such to say that it is an object of such and such type.

I can't possibly believe that IBM has created a product that doesn't support polymorphism! so.. Can anyone explain how to handle this, or point to resources which I can pass on?

4

2 回答 2

1

This may not be the problem, but you should be aware that web services, in general, do not support virtual methods. As such, they don't really support polymorphism.

In fact, web services are not object oriented at all. They're all about XML, which is not object oriented. Any resemblance to classes with methods and properties is a figment of the imagination of your tools - specifically the tools that produce your proxy classes look at the (XML) description of the web service and produce classes that are more or less like what is described.

Sometimes more, and sometimes less.

于 2009-05-08T10:28:10.887 回答
0

问题是您的客户仅通过合同或 wsdl 了解您的服务。

wsdl 仅定义合同中方法的输入和输出(以及这些方法使用的数据合同) - 它不公开服务类(或任何数据合同)的任何基类等) 您的客户将致电。

并不是 WebSphere 不能处理多态性,而是 wsdl 不能以您期望的方式表达它。

于 2010-02-03T16:07:43.827 回答