Background:
I have created a web service client VoucherWebService (consumed from an external Tomcat WSDL) which is currently deployed on a local Glassfish server (this server is also currently hosting my GWT project MyGWT).
I have found one way of calling VoucherWebService within the GWT project is by exporting VoucherWebService as an executable jar and then including it in MyGWT — both in the build path and by putting it in WEB-INF/lib.
Question:
The above method works. However, the VoucherWebService jar file is huge and I get the feeling that I now have duplicate resources on the Glassfish server (i.e. VoucherWebService is already running on the server — surely there must be an easier way of linking MyGWT with VoucherWebService). Should I be doing something else (e.g. export the auto generated VoucherWebServiceEAR project as .EAR file and use that instead)?
You should be able to call webservice method from anywhere – not only from different application at the same container (server), but also from servers on the other site of globe (not considering networking issues of course ;)) without including JAR you mentioned.
Don’t you try to use your webservice methods as a standard Java methods ? (e.g. importing some interface into your code, and calling methods on it in a standard Java way – I mean object.method())? If so, it’s inappropriate usage of webservices (we cannot even use a word ‘webservices’ in this case).