XFire

Imported WSDLs are not searched in the same directory as specified (root) one

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.1-RC1
  • Fix Version/s: 1.1
  • Component/s: Generator
  • Labels:
    None
  • Number of attachments :
    0

Description

If one use wsgen task to generate classes from mywebservice.wsdl located in ${source.dir}/wsdls, like this :
<wsgen outputDirectory="${source.dir}/java" wsdl="${source.dir}/wsdls/mywebservice.wsdl"/>
WSDLs imported from that mywebservice.wsdl are not searched in the same directory as specified WSDL, but in current directory where ant task is called, which I guess will almost never be the case since most of people place all related WSDLs in the same directory.

I guess WsGenTask should as default pass this directory parameter to underlying generation process.

Activity

Hide
Dan Diephouse added a comment -

I looked, and the WsGenTask does this already. There is even a unit test for it. Are you sure you tested it against 1.1-RC1 and not 1.1-beta?

Show
Dan Diephouse added a comment - I looked, and the WsGenTask does this already. There is even a unit test for it. Are you sure you tested it against 1.1-RC1 and not 1.1-beta?
Hide
Vjeran Marcinko added a comment -

Here is my lib directory:

xfire-all-1.1-RC1.jar
xfire-jsr181-api-1.0-M1.jar
wsdl4j-1.5.2.jar
XmlSchema-1.0.1.jar
activation-1.0.2.jar
commons-logging-1.0.4.jar
jaxb-api-2.0-ea3.jar
jaxb-impl-2.0-ea3.jar
jaxb-xjc-2.0-ea3.jar
jaxen-1.1-beta-8.jar
jdom-1.0.jar
mail-1.3.3_01.jar
servlet-api-2.3.jar
stax-api-1.0.jar
stax-utils-snapshot-20040917.jar
sun-jaxws-api-2.0-ea3.jar
sun-saaj-api-2.0-ea3.jar
sun-saaj-impl-2.0-ea3.jar
wstx-asl-2.9.jar

Here's the stack trace:

Buildfile: build.xml

wsdl2java:

BUILD FAILED
C:\IdeaProjects\xfiretest\build.xml:18: WSDLException (at /definitions/import[1]): faultCode=OTHER_ERROR: Unable to resolve imported document at 'osa.wsdl', relative to 'C:\IdeaProjects\xfiretest': This file was not found: file:/C:/IdeaProjects/xfiretest/osa.wsdl: java.io.FileNotFoundException: This file was not found: file:/C:/IdeaProjects/xfiretest/osa.wsdl
at com.ibm.wsdl.util.StringUtils.getContentAsInputStream(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.parseImport(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
at org.codehaus.xfire.wsdl11.parser.WSDLServiceBuilder.<init>(WSDLServiceBuilder.java:111)
at org.codehaus.xfire.gen.Wsdl11Generator.generate(Wsdl11Generator.java:67)
at org.codehaus.xfire.gen.WsGenTask.execute(WsGenTask.java:37)

Show
Vjeran Marcinko added a comment - Here is my lib directory: xfire-all-1.1-RC1.jar xfire-jsr181-api-1.0-M1.jar wsdl4j-1.5.2.jar XmlSchema-1.0.1.jar activation-1.0.2.jar commons-logging-1.0.4.jar jaxb-api-2.0-ea3.jar jaxb-impl-2.0-ea3.jar jaxb-xjc-2.0-ea3.jar jaxen-1.1-beta-8.jar jdom-1.0.jar mail-1.3.3_01.jar servlet-api-2.3.jar stax-api-1.0.jar stax-utils-snapshot-20040917.jar sun-jaxws-api-2.0-ea3.jar sun-saaj-api-2.0-ea3.jar sun-saaj-impl-2.0-ea3.jar wstx-asl-2.9.jar Here's the stack trace: Buildfile: build.xml wsdl2java: BUILD FAILED C:\IdeaProjects\xfiretest\build.xml:18: WSDLException (at /definitions/import[1]): faultCode=OTHER_ERROR: Unable to resolve imported document at 'osa.wsdl', relative to 'C:\IdeaProjects\xfiretest': This file was not found: file:/C:/IdeaProjects/xfiretest/osa.wsdl: java.io.FileNotFoundException: This file was not found: file:/C:/IdeaProjects/xfiretest/osa.wsdl at com.ibm.wsdl.util.StringUtils.getContentAsInputStream(Unknown Source) at com.ibm.wsdl.xml.WSDLReaderImpl.parseImport(Unknown Source) at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source) at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at org.codehaus.xfire.wsdl11.parser.WSDLServiceBuilder.<init>(WSDLServiceBuilder.java:111) at org.codehaus.xfire.gen.Wsdl11Generator.generate(Wsdl11Generator.java:67) at org.codehaus.xfire.gen.WsGenTask.execute(WsGenTask.java:37)
Hide
Vjeran Marcinko added a comment -

Just to copy-paste this import reference from my main wsdl for you to check if it's OK:

<import namespace='http://www.csapi.org/osa/wsdl' location='osa.wsdl' />

Show
Vjeran Marcinko added a comment - Just to copy-paste this import reference from my main wsdl for you to check if it's OK: <import namespace='http://www.csapi.org/osa/wsdl' location='osa.wsdl' />
Hide
Dan Diephouse added a comment -

Alright, you win Your setup looks good. There is probably something bizarrely wrong with mine. Thanks for double checking that stuff and I'll get back to you tomorrow sometime on a fix.

Show
Dan Diephouse added a comment - Alright, you win Your setup looks good. There is probably something bizarrely wrong with mine. Thanks for double checking that stuff and I'll get back to you tomorrow sometime on a fix.
Hide
Dan Diephouse added a comment -

I've deployed a new version of xfire that should have this fixed. You will need to download a copy of the XmlSchema SNAPSHOT as well:

http://cvs.apache.org/maven-snapshot-repository/org/apache/ws/commons/XmlSchema/SNAPSHOT/XmlSchema-20060506.221229-3.jar

Let me know how it goes! Thanks!!!

Show
Dan Diephouse added a comment - I've deployed a new version of xfire that should have this fixed. You will need to download a copy of the XmlSchema SNAPSHOT as well: http://cvs.apache.org/maven-snapshot-repository/org/apache/ws/commons/XmlSchema/SNAPSHOT/XmlSchema-20060506.221229-3.jar Let me know how it goes! Thanks!!!
Hide
Dan Diephouse added a comment -

Actually - I'm not sure if that jar has the required fix in it. Use this one just to be safe:

http://cvs.apache.org/maven-snapshot-repository/org/apache/ws/commons/XmlSchema/SNAPSHOT/XmlSchema-20060507.220617-4.jar

Show
Dan Diephouse added a comment - Actually - I'm not sure if that jar has the required fix in it. Use this one just to be safe: http://cvs.apache.org/maven-snapshot-repository/org/apache/ws/commons/XmlSchema/SNAPSHOT/XmlSchema-20060507.220617-4.jar
Hide
Vjeran Marcinko added a comment -

Thanx. It works OK now.

Show
Vjeran Marcinko added a comment - Thanx. It works OK now.
Hide
Dan Diephouse added a comment -

Great! Thanks so much for testing this Vjeran!

Show
Dan Diephouse added a comment - Great! Thanks so much for testing this Vjeran!

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: