Return-Path: Delivered-To: apmail-ws-tuscany-dev-archive@locus.apache.org Received: (qmail 93514 invoked from network); 16 Apr 2007 11:43:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Apr 2007 11:43:52 -0000 Received: (qmail 23345 invoked by uid 500); 16 Apr 2007 11:43:56 -0000 Delivered-To: apmail-ws-tuscany-dev-archive@ws.apache.org Received: (qmail 23318 invoked by uid 500); 16 Apr 2007 11:43:56 -0000 Mailing-List: contact tuscany-dev-help@ws.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: tuscany-dev@ws.apache.org Delivered-To: mailing list tuscany-dev@ws.apache.org Received: (qmail 23309 invoked by uid 99); 16 Apr 2007 11:43:56 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Apr 2007 04:43:56 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of simonslaws@googlemail.com designates 209.85.134.189 as permitted sender) Received: from [209.85.134.189] (HELO mu-out-0910.google.com) (209.85.134.189) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Apr 2007 04:43:49 -0700 Received: by mu-out-0910.google.com with SMTP id w8so1948066mue for ; Mon, 16 Apr 2007 04:43:28 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=googlemail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=ZfW3XYJroVtcdgX9oe/mGqzF02hvSGxxWd9p4deLKJTaHg0AtJ7tu57FvZ2HUOp+aKJIGXoc+CI1A8aDZF46gj1P7UvwnhsFbwjWRThGRul4tUbHdalPByWte82YZr0I/i96YpNp0p1vXujWeIVNtonfKlSid6bLRwKNGzqt7dA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=oSlXTitejGDE8MLkwF4is76+fvOJa10CtNj/BtGacHJ8rWuzfMqCRNGfn3Gh74OZYIxsQof7COvAUc+1SsC1Oe11X2b1jiMc0+JRkQASdSvUBcLN6oTdwU7uFHn4JtONuQJpypb+jJejfg2nMKFjVTQJUuoqaB84wNNqDA7ONh0= Received: by 10.82.185.12 with SMTP id i12mr571129buf.1176723808102; Mon, 16 Apr 2007 04:43:28 -0700 (PDT) Received: by 10.82.127.12 with HTTP; Mon, 16 Apr 2007 04:43:28 -0700 (PDT) Message-ID: Date: Mon, 16 Apr 2007 12:43:28 +0100 From: "Simon Laws" To: tuscany-dev Subject: Re: Loading XSD includes? In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_33345_8598604.1176723808072" References: X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_33345_8598604.1176723808072 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 4/16/07, Simon Laws wrote: > > I'm having problems getting XSD includes to load in the databinding itest > so am interested to know if we are using a different version of > o.a.ws.common.XmlSchema than used to be the case. I'm getting an NPE in > this package because the baseUri in the XmlSchemaCollection is not set up > correctly. I'm going to dig into why this is the case but if anyone knows > why things have changed or is alos getting this effect I would be interested > to know. > > Simon > OK, so I have not solved this satisfactorily but I have put in a work around on my machine. I added the following lines to WSDLDocumentProcessor.read() (the two lines I added are the ones with the comment above them). // Read inline schemas Types types = definition.getTypes(); if (types != null) { wsdlDefinition.getInlinedSchemas().setSchemaResolver(new URIResolverImpl()); for (Object ext : types.getExtensibilityElements()) { if (ext instanceof Schema) { Element element = ((Schema)ext).getElement(); // TODO: temporary fix to make includes in imported // schema work. The XmlSchema library was crashing // because the base uri was not set. This doesn't // affect imports. XmlSchemaCollection schemaCollection = wsdlDefinition.getInlinedSchemas(); schemaCollection.setBaseUri (((Schema)ext).getDocumentBaseURI()); wsdlDefinition.getInlinedSchemas().read(element, element.getBaseURI()); } } } The scenario I have is: WSDL XSD XSD The impact of this change is that the includes are processed BUT they are processed relative to the base URI I set up, i.e. the URI of of the WSDL document not the URI of the XML that includes them. I can work round this for the time being as all the XSDs are in the same directory (and this lets me get on and work through the rest of the test) but it's not a generic solution. So this needs some more work to either work out how to configure the XmlSchema library properly or take a look at the latest version to see if this apparent problem is fixed. Simon ------=_Part_33345_8598604.1176723808072--