开发者

if you change WCF service do you also need to change the client?

If I have a web serice and a client cons开发者_如何学编程uming tis webservice, and then I change the service location, orI add another parameter, what is the usual way to change the client? Do you necesarily need to update the client/ Was UDDI helping in this kind of situation?


You should definitely read Service Versioning - it has the information you need.

But the answer to your question is: maybe.

There are two types of changes: breaking and non-breaking. Unfortunately, sometimes it's not obvious what is a breaking or non-breaking change since it could depend on what the client is doing (and you may not have knowledge of how your service is being used).

In terms of changing the service location this is usually a breaking change. However, as you mention, if the client is using UDDI then they should be able to retrieve the new endpoint location and that change would not be a breaking change.

If you add another parameter then that might be a breaking change (or it might not). If the parameter is optional and the client is using lax versioning (e.g. WCF, .asmx) then the change should not be a breaking one. But it might be that the client is expecting a very specific format or they are doing some schema validation etc. and the optional parameter might cause a failure.


It depends on the nature of change you apply in the service definition. If you add something optional that only new clients can consume but the old clients can ommit, you have introduced a backward compatible change so the clients shouldn't be updated unless they decide to use this new feature. Any change that affects the way the existing clients use the service will require a client update as it represents a breaking change.

In the case of WCF, if you use the latest version 4.0, it introduces a new protocol implementation WS-Discovery, which can help clients to find the service url and the right version they can use. Using this approach, you can for instance, deploy a new version in a different url and the client applications can discover it automatically.

Regards Pablo.


Hey without fully understanding your problem, and from what i can get from your questino it sounds like you need to update your web reference on the client.

If you have updated your references, not changed the location: So Load up your client solution, then find your References (not dll references) but Web/Service References, and then right-click and select "update web references"

If you have changed the location, you can change the endpoint if you go to properties, but I would just delete the existing one and create a new one using the new location.

Hope it helps.

For more info check out http://msdn.microsoft.com/en-us/library/bb628652.aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜