I have been trying to figure out for > 2 days how to deploy a web service client
jar within a "Java Web Application" project in NetBeans.
If I create a web service client in a "Java Application" project, the service is
called without fail. So, it does not appear to be a connectivity/VPN issue.
However, calling the same code deployed within an external jar file in a "Java
Web Application" project yields a plethora of different
InaccessibleWsdlException causes (depending on what trial/error solution I try
to implement). I have seen "401 for URL", "PKIX path building failed",
"ValidatorException", and other errors.
Nothing I have tried has worked except simply creating a "Java Application"
project, which I cannot really use. I.e., this is a web application which has a
GoF Command
pattern calling a framework to process a web service call. The
framework is a distributed jar file and contains the commands which call the web
services. If I put the command class in the "Java Application" project, it runs
without fail. If I try to call it from within the jar file in the framework, it
always gives an "InaccessibleWsdlExeption", with various causes.
I need to know how to bundle/build/distribute/configure/whatever the framework
and/or WSDLs to be able to keep the framework separate from the rest of the
"Java Web Application" project files. This framework calls a facade, which may
call a whole different set/version of web services. It also can/will be changed
for various clients/configurations, so the external jar is necessary to avoid
having 1001 branches of the web app.
The code fails on trying to instantiate an instance of the WSDL class' web
service client.
I have tried both creating the client stubs and domain objects from both a local
WSDL and a WSDL URL, to no avail. I have only used the "Web Service Client"
wizards from within NetBeans; however, I am willing to entertain any suggestion
on manually writing one. I generally have someone write/generate the stubs for
me; but I am flying solo on this project and am a novice with NetBeans.
This is the annotation in the generated class for a web service client generated
from a local WSDL:
This is the annotation in the generated class for a web service client generated
from a WSDL URL:
I have tried deploying the "Java Application" jar file in the "Java Web
Application" and it, too, failed for the same reason(s).
I have tried various solutions found on the net (e.g., using the
BindingProvider.ENDPOINT_ADDRESS_PROPERTY, putting the wsdls and
jax-ws-catalog.xml in the META-INF folder of the jar, changing paths to
relative, et. al.). Nothing has worked except creating a "Java Application"
project, which doesn't really help me. I haven't really found anything close to
a simple guide for building this type of application. The few guides I have
found has been 1-2 hours of reading to determine that they were no where close
to solving the problem. So, I have been doing a lot of trial-and-error, which
has utterly failed.
Can anyone please help me to figure out how to bundle/build/distribute/configure
a jar file with web service client(s) in a web app's war (or whatever)?
Thanks in advance for your help.