1

I have a WCF service that has one BaseForm that is inherited numerous time (100+), some (10+) have multi-layered inheritance too. All of the derived forms are listed as KnownTypes.

The problem I am having is the time it takes for the service to start up and to generate a client reference. Using the WCF Test Client as a test it takes about 10 minutes for it to complete. If I don't reference the KnowTypes (or just list a couple) it takes about 1.5 mins to fully complete.

Is there anyway to see what is going on, why it is taking so long? Or is there a better way than the standard?

Cheers

4

1 回答 1

0

为您的服务生成的 WSDL 有多大?根据这些已知类型的大小,您可能会在“服务引用”或代理中包含大量数据。

您包含的每个对象KnownType都将添加到 WSDL 或服务元数据中。这将至少包括,

  • 对象的完全限定名(包括命名空间和 xml 命名空间)
  • 对象上所有属性的列表
  • 所有属性的所有类型的描述,即非简单类型可以有很大的描述。

当您连接到服务以请求元数据时,就像 WCF 测试客户端在您提供服务 URL 时所做的那样,它需要

  1. 请求服务生成此元数据文档,服务将调查所有对象及其属性
  2. 通过网络发送此内容 - 没什么大不了的,但不是免费的
  3. 反序列化为代理;在 WCF 测试客户端中,这意味着在表单上生成与每个对象的每个属性类型相关的字段。

你能做些什么呢?你可能不需要做任何事情。这是一次性操作 - 一旦您的服务客户端知道可以发送和接收的类型,它就会存储它们(作为生成的代码)并重用它们。

于 2016-01-15T13:56:36.320 回答