Return-Path: Delivered-To: apmail-cxf-users-archive@www.apache.org Received: (qmail 43292 invoked from network); 24 Mar 2009 13:42:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 24 Mar 2009 13:42:07 -0000 Received: (qmail 31321 invoked by uid 500); 24 Mar 2009 13:42:06 -0000 Delivered-To: apmail-cxf-users-archive@cxf.apache.org Received: (qmail 31267 invoked by uid 500); 24 Mar 2009 13:42:06 -0000 Mailing-List: contact users-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@cxf.apache.org Delivered-To: mailing list users@cxf.apache.org Received: (qmail 31257 invoked by uid 99); 24 Mar 2009 13:42:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Mar 2009 13:42:06 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of andrew.clegg@gmail.com designates 209.85.219.175 as permitted sender) Received: from [209.85.219.175] (HELO mail-ew0-f175.google.com) (209.85.219.175) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Mar 2009 13:41:57 +0000 Received: by ewy23 with SMTP id 23so3025102ewy.30 for ; Tue, 24 Mar 2009 06:41:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=j2U6c8LbAG9UE7FzqJgNWnWVos1LjPUliPfkXmJ/jEw=; b=mRpWHCWiGrpio1qdZ6Sjnw5J5NjKJMT4Q+vl6BjwVmrfztbK/GcDJMqRR1c9i2l1I+ igY1YWkQU/WbgVx+L+4FEHNA9Xdlmc4xn9ShSJtDjZzgCEcVleEJVXxkvH03LKrcsRSH mls47aBNOB03Hc5Oj12v4sl/XHnhx0OLKkZsc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=mvS1mPoV2c3GjyEgeZDN9qB/Sun1cYwYJzpDwEKps0dRq19O1Bds3p6WNSzZGdkdks ovS8UUiU+n7UMxCkSspdgtjvJNUfcyVjzFMDjMYqOggCiXTgiPgbLeL7lzqD8aBzMYvT bT4LbSjrJcTfUAevZoe3n02iuP3mi9cq7X+oE= MIME-Version: 1.0 Sender: andrew.clegg@gmail.com Received: by 10.210.43.10 with SMTP id q10mr6322664ebq.58.1237902095626; Tue, 24 Mar 2009 06:41:35 -0700 (PDT) In-Reply-To: <200903231705.36494.dkulp@apache.org> References: <200903231705.36494.dkulp@apache.org> Date: Tue, 24 Mar 2009 13:41:35 +0000 X-Google-Sender-Auth: 400b8973c3c804aa Message-ID: Subject: Re: wsdl2java -- Resolving imported schemas with relative paths From: Andrew Clegg To: Daniel Kulp Cc: users@cxf.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org I'm not sure I follow you -- the service-specific schema ws_spindlep_2_0_ws0.xsd has this line as the first element in its schema: ... which is also imported into the WSDL. I just noticed last night though that Eclipse complains about the WSDL having two wsdl:types elements, I'll try merging them and see if that makes JAXB happy... Andrew. 2009/3/23 Daniel Kulp : > > JAXB is correct here. =A0 =A0The scheme in question (the second in the ws= dl), > doesn't have any imports. =A0 Thus, it cannot reference anything outside = of > itself. =A0 There should be an import in there. > > Dan > > > On Mon March 23 2009 3:40:22 pm Andrew Clegg wrote: >> Actually, I think my previous suspicion about the cause of the problem >> may be a red herring. >> >> I've downloaded all three files: >> >> http://www.cbs.dtu.dk/ws/SpindleP/SpindleP_2_0_ws0.wsdl >> http://www.cbs.dtu.dk/ws/SpindleP/ws_spindlep_2_0_ws0.xsd >> http://www.cbs.dtu.dk/ws/common/ws_common_1_0b.xsd >> >> and saved them into one local directory, changed the schemaLocation >> elements to just refer to the filenames without any path prefixes: >> >> > namespace=3D"http://www.cbs.dtu.dk/ws/ws-common" >> schemaLocation=3D"ws_common_1_0b.xsd" >> /> >> >> and invoked wsdl2java like so: >> >> wsdl2java SpindleP_2_0_ws0.wsdl >> >> and I still get: >> >> WSDLToJava Error: Thrown by JAXB : undefined simple or complex type >> 'spindlep:seqlookup' >> >> This service works fine in SoapUI, I've sent, received and validated >> messages OK, so I'm a bit stuck... Is there some magic incantation >> that gets wsdl2java to honour imported schemas? >> >> Any suggestions greatly appreciated! >> >> Andrew. >> >> 2009/3/23 Andrew Clegg : >> > Hi, >> > >> > I'm trying to write a JAXB/JAXWS client for this service: >> > >> > http://www.cbs.dtu.dk/ws/SpindleP/ws_spindlep_2_0_ws0.xsd >> > >> > Just using wsdl2java on that URL with no extra parameters gives this >> > error: >> > >> > WSDLToJava Error: Thrown by JAXB : undefined simple or complex type >> > 'spindlep:seqlookup' >> > >> > ... presumably because all the types in use in that WSDL are defined >> > in imported schemas with relative paths: >> > >> > > > namespace=3D"http://www.cbs.dtu.dk/ws/ws-common" >> > schemaLocation=3D"../common/ws_common_1_0b.xsd" >> > /> >> > > > namespace=3D"http://www.cbs.dtu.dk/ws/ws-spindlep" >> > schemaLocation=3D"ws_spindlep_2_0_ws0.xsd" >> > /> >> > >> > ... so I tried supplying a JAXB catalog (SpindleP.cat) as described he= re: >> > >> > https://jaxb.dev.java.net/guide/Fixing_broken_references_in_schema.htm= l >> > >> > This contains the following lines: >> > >> > PUBLIC "http://www.cbs.dtu.dk/ws/ws-common" >> > "http://www.cbs.dtu.dk/ws/common/ws_common_1_0b.xsd" >> > PUBLIC "http://www.cbs.dtu.dk/ws/ws-spindlep" >> > "http://www.cbs.dtu.dk/ws/SpindleP/ws_spindlep_2_0_ws0.xsd" >> > >> > I know those XSD URLs work (you can check them yourself...). But when >> > I re-ran wsdl2java like this: >> > >> > wsdl2java -catalog SpindleP.cat >> > http://www.cbs.dtu.dk/ws/SpindleP/SpindleP_2_0_ws0.wsdl >> > >> > ... I got exactly the same error. Weirdly, even with -verbose, there's >> > no indication that wsdl2java is trying and failing to read the >> > imported schemas. It's as if it's completely ignoring the catalog >> > file. >> > >> > Any idea what I'm doing wrong? I also tried using SYSTEM paths rather >> > than PUBLIC in the catalog file, same result. Also tried both CXF 2.2 >> > and 2.1.4 with no difference. >> > >> > I could probably contact the maintainers of that service and get them >> > to provide a URL instead of a relative path, and for now I'll just >> > download and modify the appropriate files myself. But it's a bit of a >> > shame if it doesn't work as designed, especially since SoapUI just >> > resolves the locations for me automatically. If this is unexpected >> > behaviour, let me know and I'll JIRA it. >> > >> > Thanks, >> > >> > Andrew. >> > >> > -- >> > >> > :: http://biotext.org.uk/ :: > > -- > Daniel Kulp > dkulp@apache.org > http://www.dankulp.com/blog > --=20 :: http://biotext.org.uk/ ::