Ajith: Yes, it seems that WSDL4J is used to parse the wsdl serverside after I have deployed my service.
The exception originates from: com.ibm.wsdl.util.StringUtils.getContentAsInputStream If I could register a EntityResolver or simply specify a directory where WSDL4J should look for the imported schemas so I could use a relative schemaLocation it would solve my problem. Yet another possible solution would be for Axis2 to give me a chance to modify the WSDL on the fly _before_ parsing it serverside. Ali: The problem is that the host is not known when I write or rather generate my wsdl so I cannot include the hostname in the schemaLocation so no complete URL is possible. Best Regards, Johan Andersson -----Original Message----- From: "Ajith Ranabahu" <[EMAIL PROTECTED]> To: [email protected] Date: Tue, 28 Feb 2006 22:12:54 -0600 Subject: Re: [axis2] WSDL and XML Schema Imports Hi, does the error pop up from WSDL4J ? On 2/28/06, Ali Sadik Kumlali <[EMAIL PROTECTED]> wrote: > Hi Johan, > > I am not sure if it's a solution to your problem but I use real URL in > schemaLocation to get rid of this kind of problems. What I do is defining my > target URL in hosts file that maps to localhost. And also, I use Apache Web > Server or IIS to host the localhost. For example, assuming you need to make > following definition: > > schemaLocation="http://my.company.com/schemas/myschema.xsd" > > I offer you to do the following: > > 1) Add an entry to the "hosts" file: > > my.company.com localhost > > "hosts" file resides under > c:\WINDOWS\system32\drivers\etc\ in my Windows XP > > 2) Install Apache Web Server or IIS. I use Apache. > > 3) Create the "schemas" folder under htdocs folder of Apache. IIS must have > its own directory structure. > > 4) Put the "myschema.xsd" file under "schemas" folder > > 5) When you call > http://my.company.com/schemas/myschema.xsd URL with your > browser, it must be there! > > Good luck, > > Ali Sadik Kumlali > > > Johan Andersson <[EMAIL PROTECTED]> wrote: > > Hello, > > I'm struggling with schema imports in my wsdl files and would like some > hints for how to proceed. > > The hostname of the target web server/servlet container is not known at the > time I create my wsdl so I am trying to use a relative schemaLocation > in my import: > <xsd:import namespace="http://my.domain.com/common/stuff" > schemaLocation="../schemas/myschema.xsd" /> > > When I deploy my service, Axis2 will parse this wsdl and try to resolve the > location of the schema as a file and fail because the "current directory" is > not anywhere near the webapp folder. > > If I give the full URL to the imported schema > (http://myhost:port/axis2/schemas/myschema.xsd) it works > like a charm but as I said the hostname is not known at the time I create > the wsdl so this is not an option. > > Is there any way to hook in an Entity Resolver, set some kind of property to > get the wsdl4j to load schemas of the classpath or even disabling parsing of > the wsdl:types so I can get this to work please let me know. > > Best Regards > Johan Andersson > > > > > ________________________________ > Yahoo! Mail > Bring photos to life! New PhotoMail makes sharing a breeze. > > -- Ajith Ranabahu
