将 WCF 服务从 .NET 3.5 升级到 4.0 是否会更改合同?
如果我将 WCF Web 服务从 .NET 3.5 升级到 4.0,而不进行其他更改,是否存在暴露给外界的合同更改的风险? IE。我的消费者是否需要重新使用 WSDL?
如果是这样,我能做些什么来阻止这种情况发生吗?
编辑:我正在谈论的此类事情的一个例子。
我们已经使用这样的东西有一段时间了 http://www.codeproject.com/KB/aspnet/WSSecurityProvider.aspx
我可能读错了,但是当我升级服务器并从客户端重新使用时,Reference.cs 发生了更改,因此
public MyNamespace.MembershipUser RemoteMembershipProvider_CreateUser(out System.Web.Security.MembershipCreateStatus status, string providerName, string applicationName, string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey) {
return base.Channel.RemoteMembershipProvider_CreateUser(out status, providerName, applicationName, username, password, email, passwordQuestion, passwordAnswer, isApproved, providerUserKey);
}
更改为
public MyNamespace.MembershipUser RemoteMembershipProvider_CreateUser(out MyNamespace.MembershipCreateStatus status, string providerName, string applicationName, string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey) {
return base.Channel.RemoteMembershipProvider_CreateUser(out status, providerName, applicationName, username, password, email, passwordQuestion, passwordAnswer, isApproved, providerUserKey);
}
“注意 MembershipCreateStatus 的命名空间中的更改”。
(不,我真的没有一个名为 MyNamespace 的命名空间)
我是否错误地认为如果我没有重新使用,它就会停止工作?
如果没有,具体发生的变化是什么?它会影响多少其他案例?只是框架枚举?或者还不止这些?
If I upgrade a WCF Web Service from .NET 3.5 to 4.0, making no other changes, is there any risk of a change to the contract exposed to the outside world? ie. Will my consumers need to reconsume the WSDL?
If so, is there anything I can do to stop that happening?
EDIT: An example of the kind of thing I'm talking about.
We have been using something like this for a while
http://www.codeproject.com/KB/aspnet/WSSecurityProvider.aspx
I may be reading this wrong but when I upgraded the server and reconsumed from the client, the Reference.cs changed so that
public MyNamespace.MembershipUser RemoteMembershipProvider_CreateUser(out System.Web.Security.MembershipCreateStatus status, string providerName, string applicationName, string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey) {
return base.Channel.RemoteMembershipProvider_CreateUser(out status, providerName, applicationName, username, password, email, passwordQuestion, passwordAnswer, isApproved, providerUserKey);
}
changed to
public MyNamespace.MembershipUser RemoteMembershipProvider_CreateUser(out MyNamespace.MembershipCreateStatus status, string providerName, string applicationName, string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey) {
return base.Channel.RemoteMembershipProvider_CreateUser(out status, providerName, applicationName, username, password, email, passwordQuestion, passwordAnswer, isApproved, providerUserKey);
}
Note the change in namespace for MembershipCreateStatus.
(and no, I don't really have a namespace called MyNamespace)
Am I wrong in thinking that if I hadn't reconsumed, it would have stopped working?
And if not, what is the specific thing that has change and how many other cases will it effect? Just framework enums? Or more than that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,不应该有任何问题 - 毕竟,客户端和服务器之间传输的只是序列化消息。
客户端实际上并不关心服务器使用的操作系统或 .NET 版本 - 只要消息可以被理解和解释即可。
只要你不做任何改变,就应该没问题!
No, there shouldn't be any issues - after all, all that travels between the client and the server is the serialized message.
The client really doesn't care what OS or .NET version the server is on - as long as the message can be understood and interpreted.
As long as you don't change anything, you should be just fine!