Java: WSDL web service wsimport, do I need to re-run wsimport of I change the @WebService class code in the webservice server -
i'm building webservice java client , java webservice on glassfish running on windows werver 2012.
this @webservice class:
import java.util.arraylist; import java.util.list; import javax.jws.webservice; @webservice public class productcatalog { public list<string> getproductcategories(){ list<string> categories = new arraylist<>(); categories.add("books"); categories.add("music"); categories.add("movies"); return categories; } }
on client side create stub method use wsimport conversion in java generate required java source files comming wsdl xml issued ws.
what have noticed that, if add cetgory to list:
//...code categories.add("books"); categories.add("music"); categories.add("movies"); categories.add("pens"); //...code
i client side updated arraylist: book,music,movie + "pens"
- but if add new method che class, method not visible client side, how come?
- is because need run wsimport on wsdl file again , recompile client side?
- if above true, there way avoid wsimport class/source file generation everytime there change in serverside/webservice code?
thanks luther
web service typically used inter process communication , hence requires strong contract operating service. wsdl provides means of such contract. hence, need updated wsdl every time there's change in contract.
however, there's still option wsdl not required service invocation. can achieved using dynamic invocation (https://access.redhat.com/site/documentation/en-us/jboss_enterprise_application_platform/6/html/development_guide/develop_a_jax-ws_client_application.html). there pros , cons. depending on use case, may solution.
Comments
Post a Comment