Return-Path: Delivered-To: apmail-ws-axis-user-archive@www.apache.org Received: (qmail 54907 invoked from network); 1 Mar 2006 09:57:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 1 Mar 2006 09:57:46 -0000 Received: (qmail 59184 invoked by uid 500); 1 Mar 2006 09:58:04 -0000 Delivered-To: apmail-ws-axis-user-archive@ws.apache.org Received: (qmail 59110 invoked by uid 500); 1 Mar 2006 09:58:03 -0000 Mailing-List: contact axis-user-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-user@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-user@ws.apache.org Received: (qmail 58988 invoked by uid 99); 1 Mar 2006 09:58:03 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Mar 2006 01:58:03 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [212.78.199.23] (HELO smtp3.home.se) (212.78.199.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Mar 2006 01:58:02 -0800 Received: from johan.h.andersson@home.se [212.209.194.26] by home.se with NetMail ModWeb Module; Wed, 01 Mar 2006 10:48:44 +0100 Subject: Re: [axis2] WSDL and XML Schema Imports From: "Johan Andersson" To: axis-user@ws.apache.org Date: Wed, 01 Mar 2006 10:48:44 +0100 X-Mailer: NetMail ModWeb Module X-Sender: johan.h.andersson@home.se MIME-Version: 1.0 Message-ID: <1141206524.8e8957c0johan.h.andersson@home.se> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hello Ajith, thank you for responding =3D) WSDL4J picks up the relative path just fine. The problem is that a relative file path in a application server environmen= t is not predictable. Consider this (I use tomcat as example): If I start Tomcat from c:\tomcat\bin and then in a servlet (located in say = "c:\tomcat\webapps\axis2") execute the code "new File("../schemas/somesc= hema.xsd").toURL();" I will get "file:/C:/tomcat/bin/../schemas/someschem= a.xsd"=20 Looking at the WSDL4J source (not sure if I'm looking at the right version = though) and judging by the error message I get it seems that this is what= happens when Axis2 parses my wsdl. As the base URI in this case is not predictable (depends on the servlet con= tainer/application server and how it is started) I have no chance to plac= e the schemas in a location that they will get picked up by WSDL4J unless= I can somehow specify this location. The relative path must work both for WSDL4J parsing the wsdl server-side in= Axis2 and publicly for a consumer of my webservice (relative to the ?wsd= l url). I would not mind having to duplicate the schema files (two locations) as lo= ng as they are all located inside my webapp folders. Perhaps this could be solved by axis2 specifying a base URI for relative im= ports? Best Regards, Johan Andersson -----Original Message----- From: "Ajith Ranabahu" To: axis-user@ws.apache.org Date: Wed, 1 Mar 2006 02:47:54 -0600 Subject: Re: [axis2] WSDL and XML Schema Imports Hi, Hmmm.. WSDL4J has a method that allows it to use a given base uri but I'm not sure whether this is the problem. I mean wsdl4j is perfectly capable of picking up schemas from relative uri's. I'll try to test this scenario in a test case and let you know. Ajith On 3/1/06, Johan Andersson wrote: > Ajith: > > Yes, it seems that WSDL4J is used to parse the wsdl serverside after I ha= ve 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 sch= emaLocation it would solve my problem. > > Yet another possible solution would be for Axis2 to give me a chance to m= odify the WSDL on the fly _before_ parsing it serverside. > > Ali: The problem is that the host is not known when I write or rather gen= erate my wsdl so I cannot include the hostname in the schemaLocation so n= o complete URL is possible. > > Best Regards, > Johan Andersson > > > > -----Original Message----- > From: "Ajith Ranabahu" > To: axis-user@ws.apache.org > 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 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 defini= ng 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=3D"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 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: > > > schemaLocation=3D"../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 director= y" 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 crea= te > > the wsdl so this is not an option. > > > > Is there any way to hook in an Entity Resolver, set some kind of proper= ty to > > get the wsdl4j to load schemas of the classpath or even disabling parsi= ng 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 > > > > -- Ajith Ranabahu