Return-Path: X-Original-To: apmail-cxf-issues-archive@www.apache.org Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1119E179F0 for ; Thu, 2 Oct 2014 10:32:34 +0000 (UTC) Received: (qmail 99690 invoked by uid 500); 2 Oct 2014 10:32:34 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 99659 invoked by uid 500); 2 Oct 2014 10:32:33 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 99319 invoked by uid 99); 2 Oct 2014 10:32:33 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Oct 2014 10:32:33 +0000 Date: Thu, 2 Oct 2014 10:32:33 +0000 (UTC) From: "Pavol Mederly (JIRA)" To: issues@cxf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CXF-6034) Wrong schemaLocation if jax-ws-catalog is used MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CXF-6034?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Pavol Mederly updated CXF-6034: ------------------------------- Attachment: wsdl_first.zip Demonstration project (modified wsdl_first sample). After running it, point your browser to http://localhost:9090/CustomerServicePort?wsdl and see the result. > Wrong schemaLocation if jax-ws-catalog is used > ---------------------------------------------- > > Key: CXF-6034 > URL: https://issues.apache.org/jira/browse/CXF-6034 > Project: CXF > Issue Type: Bug > Components: Simple Frontend > Affects Versions: 3.0.1 > Reporter: Pavol Mederly > Attachments: wsdl_first.zip > > > When > - using a WSDL-first approach, > - defining endpoints so that *your* (not generated) WSDL is provided, > - using jax-ws-catalog > the WSDL given out to the client is sometimes incorrect. > Specifically, having entries in jax-ws-catalog like these > {code} > > > > > {code} > And having XSD imports in your types section of WSDL like these: > {code} > > > > > > > {code} > The resulting WSDL is like this (showing only the relevant part): > {code} > > > > > > {code} > (note the wrong schemaLocation attribute in the first import) > The problem occurs when the URI of the resource being imported is the same as (except for its last segment) the URI of the WSDL itself. In this case, *http://test.com/main/*schema vs. *http://test.com/main/*customer-service. > I was able to fix this preliminarily by disabling "optimization" used in WSDLGetUtils.findSchemaLocation, namely this code: > {code} > if (docBase != null && imp.getReferencedSchema() != null) { > try { > String baseURI = URLDecoder.decode(UrlUtils.getStem(docBase), "utf-8"); > String importURI = URLDecoder.decode(imp.getReferencedSchema().getDocumentBaseURI(), "utf-8"); > if (importURI.contains(baseURI)) { > schemaLocationURI = importURI.substring(baseURI.length() + 1); > } > } catch (Exception e) { > //ignore > } > } > {code} > However, I'm sure this is in fact a workaround; there should exist a cleaner solution. -- This message was sent by Atlassian JIRA (v6.3.4#6332)