The web service client jar which we are using getting updated priodically, so the client generated class appears like below,
PersonRequet1.java
PersonRequet2.java
PersonRequet3.java
StudentRequest1.java
PersonResponse1.java
PersonResponse2.java
PersonResponse3.java
StudentResponse1.java
Only PersonRequet1,PersonResponse1 classes exist in the jar initially but now it was updated with 3.
Earlier where ever we invoking service API, we used to instantiated the request and response object like below.
PersonRequet1 person=new PersonRequet1();
PersonResponse1 resp=new PersonResponse1();
Now, the problem is when ever the client jar getting updated with version number, we are forced to use the use the latest version, so we are updating the code like below-
PersonRequet3 person=new PersonRequet3();
PersonResponse3 resp=new PersonResponse3();
Is there is any way to create some config file with key value like below, and instantiate the object reference dynamically or any other good practice with pattern
PersonRequet,3
PersonResponse,3
StudentRequest,1
StudentResponse,1