This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 156908 - NB is hardcoding path to WSDL, causing errors
Summary: NB is hardcoding path to WSDL, causing errors
Status: RESOLVED FIXED
Alias: None
Product: webservices
Classification: Unclassified
Component: Client (show other bugs)
Version: 6.x
Hardware: All Mac OS X
: P3 blocker (vote)
Assignee: Milan Kuchtiak
URL: http://forums.netbeans.org/viewtopic....
Keywords:
Depends on: 149790
Blocks:
  Show dependency tree
 
Reported: 2009-01-15 18:05 UTC by hexghost
Modified: 2009-02-19 23:29 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description hexghost 2009-01-15 18:05:30 UTC
Please see my forum post in URL field. It looks like Netbeans 6.5 is hardcoding the file path to the local copy of a WSDL file when it auto-generates the Service 
class for a web service client. This will cause the application to throw exceptions when deployed to a machine other than the one where it was built. This is 
definitely new to 6.5, as my project has been working fine in NB 6.
Comment 1 Milan Kuchtiak 2009-01-16 09:28:56 UTC
Yes, that's known issue.
The workaround is to use jax-ws-catalog.xml, which maps remote resources to local files(located in project),

Example:

<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="system">
    <system systemId="http://www.webservicex.net/BibleWebservice.asmx?wsdl"
uri="wsdl/www.webservicex.net/BibleWebservice.asmx.wsdl"/>
    <system systemId="http://www.webservicex.net/globalweather.asmx?wsdl"
uri="wsdl/www.webservicex.net/globalweather.asmx.wsdl"/>
    <system systemId="file:/space/home/mkuchtiak/Documents/wsdl/AddNumbers_org.wsdl" uri="wsdl/AddNumbers_org.wsdl"/>
    <system systemId="file:/space/home/mkuchtiak/Documents/wsdl/CurrencyConvertor.asmx"
uri="wsdl/CurrencyConvertor.asmx.wsdl"/>
</catalog>

The jax-ws-catalog.xml must be located in WEB-INF(META-INF) folder and local resources are referenced relatively to this
location.

We have an enhancement for that : see the issue 149790.

Thank You for pointing at this problem again.
Comment 2 hexghost 2009-01-19 19:29:46 UTC
Hi mkuchtiak,


Even if I create a jax-ws-catalog.xml file and put it in WEB-INF/ in my netbeans project, whenever I build the project the generated Service.java source 
ignores the file, and continues to hard-code the location. What else can I do? This has totally shut down our project.
Comment 3 lagren 2009-01-19 21:54:41 UTC
I've experienced the same problem and fixed it by removing the Web Service Client and then removed the references in the
xml files. When I add the WS to the project again, the problem is gone. I'm not in front of my development machine right
now, but I think the relevant files are catalog.xml and *ws*.xml in the nbproject directory.

The only projects I have noticed this bug in, is the ones created in NB 6.1 and opened in NB 6.5. "Pure" NB 6.5 project
seems unaffected.

(If you want to try this, it's a good idea to make a backup :-P)
Comment 4 Milan Kuchtiak 2009-01-20 08:57:01 UTC
> Even if I create a jax-ws-catalog.xml file and put it in WEB-INF/ in my netbeans project, whenever I build the project
the generated Service.java source 
ignores the file, and continues to hard-code the location. What else can I do? This has totally shut down our project.

That's fine. jax-ws-catalog.xml, in runtime, should redirect hard-coded url to local file.
This is the best solution provided by JAX-WS. However, IMO this works since JAX-WS 2.1 version.
Comment 5 hexghost 2009-01-22 18:07:02 UTC
Thanks lagren - removing the web service client and then re-adding it solved the problem!
Comment 6 Milan Kuchtiak 2009-02-16 11:43:39 UTC
Fixed. Implemented jax-ws-catalog.xml

See the issue 149790.