Java 6 web services share domain classes between server and client

Context:
Given below, the defined Engine class is a parameter to some webservice method. Since we have a server and a client in java, we might have some advantages (???) when sharing the Engine class between the server and client (i.e. we can add a common jar file to add to the client and server path)

Some advantages:

  •  
  • we save certain operations like "brushEngine" in the same place  
  • build is faster because we don't need to generate Java code for client classes in our case, but use them from server build)  
  • If we later change the server implementation for the "brushEngine", this will automatically be reflected on the client.

Questions:

  • How can I pass below detailed engine class using java 6 tools (like wsimport, wsgen, etc.)?
  • Are there other java tools that can provide this exchange?
  • Does the case share that there is no java 6 web services support?
  • Could this case be boiled down to other web service usage patterns?

Thank.

Code:


public class Engine {

   private String engineData;

   public String getData(){
        return data;
   }

   public setData(String value){
        this.data = value;
   } 

   public void brushEngine(){
        engineData = "BrushedEngine"+engineData; 

   } 

}


      

+2


source to share





All Articles