You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Tevoi Andrea <te...@cad.it> on 2003/04/14 18:41:16 UTC

wsdl:import URL

Hi all,

I have a wsdl(1) that imports another wsdl(2). They are deployed under Axis and wsdd specifies the location of wsdl 1. A browser can successfully show it. But wsdl2java cannot resolve import location specified in wsdl. It seems that Axis servlet doesn't manage servlet context relative URLs.

I mean:

<definitions name="1" targetNamespace="http://1" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://1" xmlns:abs="http://2">
<import namespace="http://2" location="2.wsdl"/>
...

This is a portion of wsdl 1. Wsdl 2 is in the same directory under axis.

Wsdl2java gives this exception:

WSDLException: faultCode=OTHER_ERROR: Unable to resolve imported document at '2.wsdl'.: This file was not found: file:2.wsdl: java.net.MalformedURLException: This file was not found: file:2.wsdl at com.ibm.wsdl.util.StringUtils.getURL(Unknown Source) 	at com.ibm.wsdl.util.StringUtils.getURL(Unknown Source) 	at com.ibm.wsdl.util.StringUtils.getURL(Unknown Source) 	at com.ibm.wsdl.util.StringUtils.getURL(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 org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:406) 	at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:393) 	at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:245) 	at java.lang.Thread.run(Thread.java:536)  	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 org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:406) 	at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:393) 	at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:245) 	at java.lang.Thread.run(Thread.java:536)


It seems that I must specify the full path on file system to reach the imported wsdl 2.

Any helps?

thanks in advance,

A.T.

RE: wsdl:import URL

Posted by Anne Thomas Manes <an...@manes.net>.
Location must be a full URL, not a relative URL, per the WSDL spec.
See http://www.w3.org/TR/wsdl#_document-n.


> -----Original Message-----
> From: Tevoi Andrea [mailto:tevoi@cad.it]
> Sent: Monday, April 14, 2003 12:41 PM
> To: axis-user@ws.apache.org
> Subject: wsdl:import URL
> 
> 
> Hi all,
> 
> I have a wsdl(1) that imports another wsdl(2). They are deployed 
> under Axis and wsdd specifies the location of wsdl 1. A browser 
> can successfully show it. But wsdl2java cannot resolve import 
> location specified in wsdl. It seems that Axis servlet doesn't 
> manage servlet context relative URLs.
> 
> I mean:
> 
> <definitions name="1" targetNamespace="http://1" 
> xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://1" 
> xmlns:abs="http://2">
> <import namespace="http://2" location="2.wsdl"/>
> ...
> 
> This is a portion of wsdl 1. Wsdl 2 is in the same directory under axis.
> 
> Wsdl2java gives this exception:
> 
> WSDLException: faultCode=OTHER_ERROR: Unable to resolve imported 
> document at '2.wsdl'.: This file was not found: file:2.wsdl: 
> java.net.MalformedURLException: This file was not found: 
> file:2.wsdl at com.ibm.wsdl.util.StringUtils.getURL(Unknown 
> Source) 	at com.ibm.wsdl.util.StringUtils.getURL(Unknown 
> Source) 	at com.ibm.wsdl.util.StringUtils.getURL(Unknown 
> Source) 	at com.ibm.wsdl.util.StringUtils.getURL(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 
> org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.
> java:406) 	at 
> org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.
> java:393) 	at 
> org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:245) 
> 	at java.lang.Thread.!
> run(Thread.java:536)  	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 
> org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.
> java:406) 	at 
> org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.
> java:393) 	at 
> org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:245) 
> 	at java.lang.Thread.run(Thread.java:536)
> 
> 
> It seems that I must specify the full path on file system to 
> reach the imported wsdl 2.
> 
> Any helps?
> 
> thanks in advance,
> 
> A.T.
>