1

我有两个代码优先的 WCF Web 服务,它们公开了一些相同的常见类型。WCF 已选择将这些类型放在每个 Web 服务的不同 XSD 中。

比如在Web Service 1中,我常用的类型在xsd3中。在 Web 服务 2 中,它们位于 xsd4 中。

这完全是由 WCF 选择的,还是有办法影响它放在哪里?我查看了服务属性、操作和数据合同属性,但没有发现任何似乎可以做到这一点的东西。

这会导致我们基于 Java 的 Web 服务客户端之一出现问题,因为不同的 XSD 会导致类型重复。

4

1 回答 1

1

You cannot control the WSDL generation as far as how types are imported (i.e. XSD names) - this is entirely automatic and up to .NET internals. If this is an issue for you - you may consider merging Service 1 and Service 2 so that the type aren't duplicated OR you may need to isolate your service references using namespaces / separate projects libraries in Java to avoid type collisions.

于 2012-05-31T15:42:07.450 回答