[
https://issues.jboss.org/browse/JBWS-3792?page=com.atlassian.jira.plugin....
]
R Searls commented on JBWS-3792:
--------------------------------
This is not a bug. There are a couple of reasons why. One, SOAPAddressWSDLParser
is not called during the deployment process, the time when imported wsdl
and schema files are processed. A similar bug was filed,
https://issues.jboss.org/browse/JBWS-3571 and closed as "WON'T FIX" for the
same reason.
Two, the namespace attribute of the "wsdl:import" and schema import is not used
in locating the file. It is for "targetNamespace" identification only.[1]
The attribute location and schemaLocation respectively are
used for file location. It is standard practice that, "WSDL files are located
relative to the root of the module and are typically located in the wsdl directory
that is co-located with the module."[2] Directory META-INF/wsdl for EJB jar [3] and
directory WEB-INF/wsdl [4] for WAR archives. In addition imported and included
documents of wsdl and schema files are co-located relative to the wsdl directory.
JBossWs provides a custom resolver
(org.jboss.wsf.stack.cxf.resolver.JBossWSResourceResolver)
to find such config files in a deployed EE archive. 6 tests have been added to test
representative wsdl:import scenarios.[5]
[1]
http://www.w3.org/TR/wsdl#_Toc492291093 , 3.1.1.1 namespace attribute information
item
[2] Web Services for Java EE, Version 1.4, section 5.4 Packaging
[3] Web Services for Java EE, Version 1.4, section 5.4.2 EJB Module Packaging
[4] Web Services for Java EE, Version 1.4, section 5.4.3 Web Module Packaging
[5]
https://svn.jboss.org/repos/jbossws/stack/cxf/trunk
Subversion: Committed revision 18955
JBossWS: wsdl:import always handled as relative location
--------------------------------------------------------
Key: JBWS-3792
URL:
https://issues.jboss.org/browse/JBWS-3792
Project: JBoss Web Services
Issue Type: Bug
Components: jbossws-cxf
Affects Versions: jbossws-cxf-4.3
Reporter: Marc H.
Assignee: R Searls
Fix For: jbossws-cxf-5.0
Attachments: JBWS-3792_java.net.URL_proposal.patch
As described in this thread:
https://community.jboss.org/thread/240821
wsdl:import directive seems to be always resolved as a relative location.
For example, this statement:
<wsdl:import
namespace="http://foo.bar.com/foo.bar.Service"
location="http://foo.bar.com/Service.svc?wsdl=wsdl0"/>
May result in this URL being resolved:
http://foo.bar.com/http://foo.bar.com/Service.svc?wsdl=wsdl0
This prevents the WSDL file from being parsed.
This behavior seems to originate from:
org.jboss.ws.common.deployment.SOAPAddressWSDLParser, line 211 in v2.3.0.Final and current
trunk:
} else if (match(reader, WSDL_NS, IMPORT)) {
final String location = reader.getAttributeValue(null, LOCATION);
final String url = wsdlUrl.toString();
final String newUrl = url.substring(0, url.lastIndexOf("/") +
(location.startsWith("/") ? 0 : 1)) + location;
if (!metadata.getImports().containsKey(newUrl)) {
metadata.getImports().put(newUrl, false);
}
}
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)