wood burning stoves 2.0*
The moose likes Web Services and the fly likes NetBeans 7.2 Web Service Client:  InaccessibleWsdlException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "NetBeans 7.2 Web Service Client:  InaccessibleWsdlException" Watch "NetBeans 7.2 Web Service Client:  InaccessibleWsdlException" New topic
Author

NetBeans 7.2 Web Service Client: InaccessibleWsdlException

IvanG Bell
Greenhorn

Joined: Sep 12, 2012
Posts: 5
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.
IvanG Bell
Greenhorn

Joined: Sep 12, 2012
Posts: 5
Okay, so in order to eliminate some clutter, I broke the project down into three separate projects:

1) The Web Service stubs.

This project is simply all of the stubs (i.e., clients) compiled into its own jar file.

2) The command framework.

This project is the GoF Command framework (called by the Java Web Application). It has the web service stubs jar in its classpath.

3) The NetBeans Java Web Application project.

This project generates the war file used to deploy the solution.


I am still getting the "2 counts of InaccessibleWsdlException" error; but am now consistently getting a "401 for URL" cause. I am looking into how to bundle authenticated web service clients now.

Any help on this would be appreciated.
IvanG Bell
Greenhorn

Joined: Sep 12, 2012
Posts: 5
Ok, with the help of http://netbeans.org/bugzilla/show_bug.cgi?id=136115 and http://stackoverflow.com/questions/4163586/jax-ws-client-whats-the-correct-path-to-access-the-local-wsdl, I am a little closer. I am now getting a "Got Connection refused" error. Anyone seen this?
IvanG Bell
Greenhorn

Joined: Sep 12, 2012
Posts: 5
I am past creating the service object. 3 days of hell and now it is failing on the very next statement (creating a port from the service object).



Fails on line #4. I am getting "Unable to create JAXBContext" caused by a lot of conflicts:



So, it seems as if it is not reading my bindings/schema correctly. Can anyone out there please help me with this? I simply want to call my client's web service over https. I am using a jax-ws client generated by NetBeans 7.2. I have no control over their services, can't change the security, can't put the SSL on the VPN tunnel, et. al. And, yet, I can't seem to write a client bundled in a war file that can communicate with it. I know that someone on the globe has done this. I hope they read and respond.
IvanG Bell
Greenhorn

Joined: Sep 12, 2012
Posts: 5
Okay, so I gave up and deleted all of the projects and started from scratch, to no avail. I got the same errors as before.

So, I uninstalled NetBeans, cleaned up registry, directories, old project files (e.g., build.xml, nbproperties), et. al. Then I reinstalled NetBeans, created new projects from existing sources and voila! Everything is working as it should have on the first day of this trial.

I have three projects.

1) The Web Service stubs.

This NetBeans Java Application project is simply all of the stubs (i.e., clients) compiled into its own jar file. Created all of the Web Service References from the WSDL URLs and did a build into the jar.

2) The command framework.

This project is the GoF Command framework (called by the Java Web Application). It has the web service stubs jar (created from #1 above) in its classpath.

3) The NetBeans Java Web Application project.

This project contains both libraries (from #1 and #2) and generates the war file used to deploy the solution.

I hope this helps anyone else who struggles with this issue. I found nothing like it on the web. I haven't used the "uninstall/reinstall" strategy since the late 80's early 90's. Go figure.
cesar diaz
Greenhorn

Joined: Oct 23, 2012
Posts: 1
Hi, I have the following problem




Can you help me, to please?
 
Consider Paul's rocket mass heater.
 
subject: NetBeans 7.2 Web Service Client: InaccessibleWsdlException
 
Similar Threads
How is it determined what web service artifacts are Published to data/wsdl?
JAX-WS dependency injection
Please Help regarding error while create *Service class by using wsimport glassfish v2
developing web services using netbeans (error on deploying application)
NetBeans JAX-WS WSDL