aspose file tools*
The moose likes Web Services and the fly likes clients stubs regeneration Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "clients stubs regeneration" Watch "clients stubs regeneration" New topic
Author

clients stubs regeneration

Luciano A. Pozzo
Ranch Hand

Joined: Jun 20, 2005
Posts: 112
Hi all,

In some cases I need to add a field in a complex type of return. The problem is that the service is used by many systems, and in some cases I do not know them until they give error. What is the best way to avoid this problem? For example, everything to continue operating without new information, without generating errors?

I am using Axis.

Tks
Jim Akmer
Ranch Hand

Joined: Jul 06, 2010
Posts: 104
Hi,

If you add an element to an existing return type of an operation, clients will fail. To avoid regenerating the client stubs (since they are out of your control) you must version your web services, so that old clients (that know about the previous format of the data type) are redirected to a version of your web service that will return back, an object of the type they can understand.
Check out these:
WS backward compatibility
WS-SOA backward compatibility
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
If you do WSDL-first development, then you can set minOccurs for any field to zero, in which case it becomes optional.
Of course your code will have to written accordingly, so that it does not assume there is a value for such a field.
This way you do not have to regenerate any client artifacts.
Best wishes!


My free books and tutorials: http://www.slideshare.net/krizsan
Luciano A. Pozzo
Ranch Hand

Joined: Jun 20, 2005
Posts: 112
Thank's Jim and Ivan!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: clients stubs regeneration