将 agument 设为可选时,是否需要更新 WCF 服务引用?

编程入门 行业动态 更新时间:2024-10-27 04:34:54
本文介绍了将 agument 设为可选时,是否需要更新 WCF 服务引用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我们有一个被许多其他进程使用的网络服务.它需要一个对象(由 XSD 制成)作为参数.此对象中的一个属性(日期时间)现在可以为空.

We have a webservice that is used by a lot of other processes. It takes an object (made from an XSD) as an argument. One of the properties (a datetime) in this object is now made nullable.

问题是:我现在是否必须找到引用此 Web 服务的所有进程并更新它们的引用,以便它们继续工作?

The question is: Do I now have to find all of the processes that reference this webservice and update their reference, in order for them to keep working?

推荐答案

这是一个棘手的问题.

我认为您应该没问题,因为您没有在界面中删除或添加新参数.

I am thinking you should be fine because you are not removing or add new parameters to the interface.

这只是对现有参数的简单更改,在我看来,您只是放松了此处的约束.不是强制参数不能接受空值,而是说现在是.

It is just a simple change to an existing parameter and in my opinion you are just relaxing the constraint here. Instead of enforcing the parameter to not able to accept null, you are saying it now is.

我相信现有进程必须已经为该 dateTime 属性设置了不可为空的值?因此,要使新流程利用更改,它们必须更新引用,否则不需要更改.

I believe existing processes must have already be setting non-nullable value for that dateTime property? So for new processes to take advantage of the change, they will have to update the reference, otherwise no change is required.

不过,更改服务合同通常是一个坏主意.您是否考虑过在发行说明中包含更改?以便您的客户了解并采取适当的措施.

Still, changing service contract is generally a bad idea though. Have you look at including the change in your release notes? So that your clients are aware and can do the appropriate measures.

这是另一个可能会给您带来麻烦的重大更改列表.

Here is another list of breaking changes that might give you trouble.

删除操作更改操作名称删除操作参数添加操作参数更改操作参数名称或数据类型更改操作的返回值类型通过显式使用 .NET 属性或自定义序列化代码更改参数类型(数据协定)或操作(消息协定)的序列化 XML 格式修改服务操作编码格式(RPC 编码与文档文字)

这篇关于将 agument 设为可选时,是否需要更新 WCF 服务引用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-26 19:13:42,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1141042.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:设为   可选   agument   WCF

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!