File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

clients stubs regeneration

 
Luciano A. Pozzo
Ranch Hand
Posts: 112
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 104
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2198
1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Luciano A. Pozzo
Ranch Hand
Posts: 112
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank's Jim and Ivan!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic