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 158226 - EJB as WS client requires hardcoded path
Summary: EJB as WS client requires hardcoded path
Status: RESOLVED FIXED
Alias: None
Product: webservices
Classification: Unclassified
Component: JAX-WS (show other bugs)
Version: 6.x
Hardware: PC All
: P2 blocker (vote)
Assignee: Milan Kuchtiak
URL:
Keywords:
Depends on: 149790
Blocks:
  Show dependency tree
 
Reported: 2009-02-09 20:03 UTC by jasonray76
Modified: 2009-02-19 23:29 UTC (History)
2 users (show)

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 jasonray76 2009-02-09 20:03:43 UTC
Within an EJB, if developer adds a WS client, the path to the WSDL/schema is a hardcoded path.  This results in the path
that existed at development time required to be present in the run-time environment.

We are using Netbeans with GlassfishESB.

I have opened this as a netbean issue based on the assumption that the probably is caused by the IDE placing the
hardcoded path into the jar.
Comment 1 jasonray76 2009-02-09 21:05:08 UTC
I have a sample to demonstrate issue, but it is too large to attach.
Comment 2 Petr Jiricka 2009-02-10 15:58:04 UTC
Reassigning to web services.
Comment 3 Milan Kuchtiak 2009-02-10 16:48:13 UTC
The jax-ws-catalog.xml file should help.
This is a mechanism to map remote/local xml resources to local files located in project, under WEB-INF/wsdl.

Can you please, at least, copy those hard coded paths to this issue ?
Comment 4 jasonray76 2009-02-10 17:44:35 UTC
I have uploaded sample to my ftp server.  You can download from there:

ftp://ftp.agilexhealth.com/outgoing/NHINC/SampleForSun/WSDLClientFileIssue_OldESB.zip

user: FTPOut
password: Ag1l3xHC0ut!

Inside the zip is a readme.  This is "issue 2" explained in there.

The hardcoded path can be seen here in the wsdlLocation attribute:
    <target name="wsimport-client-uddi_v3_service" depends="wsimport-init,wsimport-client-check-uddi_v3_service"
unless="wsimport-client-uddi_v3_service.notRequired">
        <wsimport xendorsed="true" sourcedestdir="${build.generated.dir}/wsimport/client" extension="true"
destdir="${build.generated.dir}/wsimport/binaries"
wsdl="${basedir}/${meta.inf}/xml-resources/web-service-references/uddi_v3_service/wsdl/uddi_v3_service.wsdl"
wsdlLocation="file:/C:/projects/nhinc/Current/Product/Production/Tutorials/WSDLClientFileIssue/WSDLInterfaces/src/wsdl/uddi_v3_service.wsdl"
catalog="catalog.xml"/>
        <copy todir="${classes.dir}">
            <fileset dir="${build.generated.dir}/wsimport/binaries" includes="**/*.xml"/>
        </copy>
    </target>
Comment 5 Milan Kuchtiak 2009-02-11 09:30:23 UTC
There is a workaround for that even in 6.5:
wsdlLocation can be changed in :
WS Client node -> Edit WS Attributes action -> Wsimport tab

Just specify wsdlLocation value there.

Anyway, after implementing jax-ws-catalog.xml mechanism this - additional step will not be required.

Thank You for your patience.
Comment 6 jasonray76 2009-02-11 12:10:14 UTC
Thank you, we will try the workaround
Comment 7 jasonray76 2009-02-11 12:14:03 UTC
Can you point me to some documentation on how to utilize the catalog?
Comment 8 Milan Kuchtiak 2009-02-11 14:24:21 UTC
See:
https://jax-ws.dev.java.net/nonav/2.1.5/docs/UsersGuide.html
(Catalog section)
Comment 9 jasonray76 2009-02-11 14:32:09 UTC
Thanks for the documentation.

I have a question that came from one of our developers on the workaround: We are doing this under Netbeans bundled with
Glassfish ESB.  The catalog file (catalog.xml) is generated for us automatically.  Is it okay for us to modify the
catalog file?  Doesn't this file get regenerated automatically based on certain actions?
Comment 10 Milan Kuchtiak 2009-02-11 14:54:40 UTC
Yes, you can simply copy the catalog.xml file to WEB-INF(META-INF), rename the copy to jax-ws-catalog.xml.

Then copy the wsdl (and schema files) into WEB-INF(META-INF)/wsdl and replace relative references in jax-ws-catalog.xml.
You don't need to care about catalog.xml file. It is used by wsimport utility sometimes. (Clean & Build).

Example of jax-ws-catalog.xml(located in META-INF):

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="system">
    <system systemId="file:/space/home/mkuchtiak/Documents/wsdl/Hello.wsdl" uri="wsdl/Hello.wsdl"/>
</catalog>

(Hello.wsdl file is located in META-INF/wsdl)
Comment 11 Milan Kuchtiak 2009-02-16 11:44:30 UTC
Fixed:
http://hg.netbeans.org/main?cmd=changeset;node=880e0af72618

See also the issue 149790.
Comment 12 Quality Engineering 2009-02-18 10:21:33 UTC
Integrated into 'main-golden', will be available in build *200902180201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/880e0af72618
User: mkuchtiak@netbeans.org
Log: #158226, #158231, #149790 implement jax-ws-catalog for Ant projects