使用Framework复杂类型(版本)的服务的WCF服务引用 [英] WCF service reference to service using Framework complex types (Version)

查看:51
本文介绍了使用Framework复杂类型(版本)的服务的WCF服务引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近通过OData接口公开了一个System.Version,看起来工作愉快,因为Version是一个"简单"类型,可以很容易地表示为OData复杂类型:

I recently exposed a System.Version through the OData interface, which appears to work happily as Version is a 'simple' type that easily can be represented as an OData Complex Type:

< Schema   xmlns =" http ://schemas.microsoft.com/ado/2009/11/edm " <跨度>&NBSP; <跨度>命名空间 =" <跨度>系统 " >
<Schema xmlns="http://schemas.microsoft.com/ado/2009/11/edm" Namespace="System">

推荐答案

是否无法生成代码或生成无法编译的代码?

Is it failing to generate code or producing code that fails to compile?

如果它甚至无法生成,那么这可能是故意的,但我需要看看错误信息是什么样的。

If it's failing to even generate, then this is probably intentional, but I would need to see what the error message looks like.

我们这里的选择是公平的有限。我们当然不希望生成另一个System.Version副本,因为这会导致许多编译问题。我们可以尝试检测EDM类型是否与System类型完全匹配,只是重用系统
类型,但这不是我们已经看到很多需求的场景(尽管它完全有效)。我们还可以投入更多资金来开放添加服务参考体验,以允许更多自定义生成器,特别是允许使用自定义T4模板。
最后一个选项是最灵活的,并且经常被团队讨论,但尚未承诺任何特定版本。

Our options here are fairly limited. We certainly don't want to generate another copy of System.Version, as that would lead to lots of compilation issues. We could try to detect whether an EDM type perfectly matches a System type and just reuse the system type, but it's not a scenario we've seen much demand for (though it's perfectly valid). We could also invest more in opening up the Add Service Reference experience to allow more customized generators, and in particular allow the use of custom T4 templates. The last option is the most flexible and has been often discussed by the team, but has not yet been committed to for any particular release.

目前,我们有一个更好地了解它失败的地方我们可以看到是否有解决方法。

For now, once we have a better sense of where it's failing we can see if there is a workaround or not.


这篇关于使用Framework复杂类型(版本)的服务的WCF服务引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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