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 3144C10C95 for ; Tue, 19 May 2015 19:40:00 +0000 (UTC) Received: (qmail 7336 invoked by uid 500); 19 May 2015 19:40:00 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 7301 invoked by uid 500); 19 May 2015 19:40:00 -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 7287 invoked by uid 99); 19 May 2015 19:39:59 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 May 2015 19:39:59 +0000 Date: Tue, 19 May 2015 19:39:59 +0000 (UTC) From: "Jader da Silva Santos (JIRA)" To: issues@cxf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CXF-6413) WSDL Import SchemaLocation Error on Relative Path 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-6413?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jader da Silva Santos updated CXF-6413: --------------------------------------- Description: When importing multiple levels of XSDs in a WSDL, the schemaLocation attribute produces an error in the translated URL. Folder Structure: {noformat} wsdl | +--UserService wsdl | +--schema | +--type | | | +-- user | | | +--user xsd | +-- phone | | | +--phone xsd +--xsd | +--UserService xsd {noformat} {code:title=UserService.wsdl|borderStyle=solid} {code} {code:title=UserService.xsd|borderStyle=solid} {code} {code:title=user.xsd|borderStyle=solid} {code} {code:title=phone.xsd|borderStyle=solid} {code} Error: When running on started server, the schemaLocation attribute in UserService.xsd don't resolve the absolute path, causing error. WSDLGetUtils.java In 2.7.7 version of CXF library, mapUri() method resolves correctly. {code:title=mapUri()|borderStyle=solid} protected String mapUri(String base, Map smp, String loc) throws UnsupportedEncodingException { SchemaReference ref = (SchemaReference) smp.get(URLDecoder.decode(loc, "utf-8")); if (ref != null) { return new StringBuilder().append(base).append("?xsd=") .append(ref.getSchemaLocationURI().replace(" ", "%20")).toString(); } return null; } {code} After 2.7.7 version, for example 3.1.0 version, mapUri() was changed. The "loc" parameter is changed in this line "key = new URI(xsd).resolve(loc).toString();". After that change, the imported XSD is not found on the map "SchemaReference ref = (SchemaReference)smp.get(URLDecoder.decode(key, "utf-8"));". This error is blocking WSDL first aproach development using JBoss AS and JAX-WS. was: When importing multiple levels of XSDs in a WSDL, the schemaLocation attribute produces an error in the translated URL. Folder Structure: {noformat} wsdl | +--UserService wsdl | +--schema | +--type | | | +-- user | | | +--user xsd | +-- phone | | | +--phone xsd +--xsd | +--UserService xsd {noformat} ---------------------------------------------------------------------------------------------- UserService.wsdl ---------------------------------------------------------------------------------------------- {noformat} {noformat} ---------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------- UserService.xsd ---------------------------------------------------------------------------------------------- {noformat} {noformat} ---------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------- user.xsd ---------------------------------------------------------------------------------------------- {noformat} {noformat} ---------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------- phone.xsd ---------------------------------------------------------------------------------------------- {noformat} {noformat} ---------------------------------------------------------------------------------------------- Error: When running on started server, the schemaLocation attribute in UserService.xsd don't resolve the absolute path, causing error. WSDLGetUtils.java In 2.7.7 version of CXF library, mapUri() method resolves correctly. {noformat} protected String mapUri(String base, Map smp, String loc) throws UnsupportedEncodingException { SchemaReference ref = (SchemaReference) smp.get(URLDecoder.decode(loc, "utf-8")); if (ref != null) { return new StringBuilder().append(base).append("?xsd=") .append(ref.getSchemaLocationURI().replace(" ", "%20")).toString(); } return null; } {noformat} After 2.7.7 version, for example 3.1.0 version, mapUri() was changed. The "loc" parameter is changed in this line "key = new URI(xsd).resolve(loc).toString();". After that change, the imported XSD is not found on the map "SchemaReference ref = (SchemaReference)smp.get(URLDecoder.decode(key, "utf-8"));". This error is blocking WSDL first aproach development using JBoss AS and JAX-WS. > WSDL Import SchemaLocation Error on Relative Path > ------------------------------------------------- > > Key: CXF-6413 > URL: https://issues.apache.org/jira/browse/CXF-6413 > Project: CXF > Issue Type: Bug > Components: Core > Affects Versions: 2.7.11, 2.7.13, 3.1.0 > Environment: Wildfly 8.1; Windows 7 > Reporter: Jader da Silva Santos > > When importing multiple levels of XSDs in a WSDL, the schemaLocation attribute produces an error in the translated URL. > Folder Structure: > {noformat} > wsdl > | > +--UserService wsdl > | > +--schema > | > +--type > | | > | +-- user > | | > | +--user xsd > | +-- phone > | | > | +--phone xsd > +--xsd > | > +--UserService xsd > {noformat} > {code:title=UserService.wsdl|borderStyle=solid} > > xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://test.com.br/integration/services/user" > xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" > xmlns:sch="http://test.com.br/integration/schema" > name="UserServiceService" targetNamespace="http://test.com.br/integration/services/user"> > > > > > > > > > > > > > > > > > > > transport="http://schemas.xmlsoap.org/soap/http" /> > > > > > > > > > > > > > > > > > {code} > {code:title=UserService.xsd|borderStyle=solid} > > xmlns:tns="http://test.com.br/integration/schema" xmlns:ns2="http://test.com.br/integration/schema/user" > elementFormDefault="unqualified" targetNamespace="http://test.com.br/integration/schema" > version="1.0"> > > > > > > > > > > > > > > > {code} > {code:title=user.xsd|borderStyle=solid} > > xmlns:ns1="http://test.com.br/integration/schema/phone" > targetNamespace="http://test.com.br/integration/schema/user" version="1.0"> > > > > > > > > > > {code} > {code:title=phone.xsd|borderStyle=solid} > > targetNamespace="http://test.com.br/integration/schema/phone" version="1.0"> > > > > > > > > > {code} > Error: > When running on started server, the schemaLocation attribute in UserService.xsd don't resolve the absolute path, causing error. > WSDLGetUtils.java > In 2.7.7 version of CXF library, mapUri() method resolves correctly. > {code:title=mapUri()|borderStyle=solid} > protected String mapUri(String base, Map smp, String loc) > throws UnsupportedEncodingException { > SchemaReference ref = (SchemaReference) smp.get(URLDecoder.decode(loc, "utf-8")); > if (ref != null) { > return new StringBuilder().append(base).append("?xsd=") > .append(ref.getSchemaLocationURI().replace(" ", "%20")).toString(); > } > return null; > } > {code} > After 2.7.7 version, for example 3.1.0 version, mapUri() was changed. The "loc" parameter is changed in this line "key = new URI(xsd).resolve(loc).toString();". After that change, the imported XSD is not found on the map "SchemaReference ref = (SchemaReference)smp.get(URLDecoder.decode(key, "utf-8"));". > This error is blocking WSDL first aproach development using JBoss AS and JAX-WS. -- This message was sent by Atlassian JIRA (v6.3.4#6332)