[
https://issues.apache.org/jira/browse/CXF-8893?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17738335#comment-17738335
]
Mark Kahl commented on CXF-8893:
--------------------------------
Dear [~reta],
I absolutely agree with you that most namespaces end with a slash. However,
emphasis on "{*}most{*}". Unfortunately, I have to deal with the few, and have
zero influence on their behaviour.
A commercial product shall request my SOAP-Service, but signals failure (please
excuse the pathetic attempts to veil the company and purpose descriptors, I'm
entitled to).
* javax.xml.ws.WebServiceException:
{http://aaa.webservice.bbb.de}AaaService
ist kein gültiger Service. Gültige Services sind:
{http://aaa.webservice.bbb.de{color:#FF0000}/{color}}AaaService
meaning:
* javax.xml.ws.WebServiceException:
{http://aaa.webservice.bbb.de}AaaService
is no valid Service. Valid services are:
{http://aaa.webservice.bbb.de{color:#FF0000}/{color}}AaaService
Unfortunately, the message is a bit confusing. It should be read as: "I was
expecting: 'aaa.webservice.bbb.de' but have been
offered:'aaa.webservice.bbb.de{color:#FF0000}/{color}' so I refuse to work with
you".
The effect of the trailing slash can be seen when comparing the CXF input WSDL
(and yes several of the namespaces have a trailing slash, just not the ones
required by the commercial product):
* <?xml version='1.0' encoding='UTF-8'?>
<wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="{color:#ffbdad}http://aaa.webservice.bbb.de{color}"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:ns2="http://schemas.xmlsoap.org/soap/http"
xmlns:ns1="http://aaa.webservice.bbb.de"
name="AaaService"
targetNamespace="{color:#ffbdad}http://aaa.webservice.bbb.de{color}">
...
to the one returned when the service is asked to return its WSDL
([http://localhost?wsdl),|http://localhost/?wsdl),] which to my understanding
is created by CXF at runtime:
* <?xml version='1.0' encoding='UTF-8'?>
<wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="{color:#ff8b00}{color:#ffbdad}http://aaa.webservice.bbb.de{color}{color:#de350b}/{color}{color}"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:ns2="http://schemas.xmlsoap.org/soap/http"
xmlns:ns1="http://aaa.webservice.bbb.de" name="AaaService"
targetNamespace="{color:#ff8b00}{color:#ffbdad}http://aaa.webservice.bbb.de{color}{color:#de350b}/{color}{color}">
...
The client that requests my service does not simply call the known endpoints,
which it could, but request the WSDL first, does not find the expected
namespace and refuses further requests. I am happy to agree that this is not a
very smart behaviour, but my hands are tight regarding this matter.
Cheers Mark.
> Hard coded slashes at the end of SOAP namespaces are not always appreciated
> ---------------------------------------------------------------------------
>
> Key: CXF-8893
> URL: https://issues.apache.org/jira/browse/CXF-8893
> Project: CXF
> Issue Type: Improvement
> Components: Core, JAX-WS Runtime
> Affects Versions: 4.0.2
> Reporter: Mark Kahl
> Priority: Major
>
> There are some functions that explicitly append a slash to URL's (see below),
> which is not always helpful. I have a client, unfortunately not under my
> jurisdiction, that refuses to work with my SOAP-service, since the service
> exports a WSDL-file, generated by CXF, that has a slash appended.
> I understand that just skipping the slash probably will affect a plethora of
> applications that rely on it, so maybe an option could be introduced
> modifying line 178 in the class: "PackageUtils" to:
> * return "http://" + String.join(".", parts) + *((optionNoTrailingSlash) ?
> "" :* '/'{*}){*};
> instead of the current:
> * return "http://" + String.join(".", parts) + '/';
> for example.
> h1. Statements that immutably append slashes
> The following list is the result of a regular expression search, probably not
> all of them are relevant.
> core/src/main/java/org/apache/cxf/common/util/PackageUtils.java:178:
> return "http://" + String.join(".", parts) + '/';
> core/src/main/java/org/apache/cxf/helpers/ServiceUtils.java:211:
> return protocol + "://" + String.join(".", words) + "/";
> rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/NewCookieHeaderProvider.java:43:
> private static final String TSPECIALS_ALL = TSPECIALS_PATH + "/";
> rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriInfoImpl.java:230:
> address = address + "/";
> rt/rs/description-swagger-ui/src/main/java/org/apache/cxf/jaxrs/swagger/ui/SwaggerUiResolver.java:69:
> return urlStr + UI_RESOURCES_ROOT_START + version + "/";
> rt/transports/http/src/main/java/org/apache/cxf/transport/http/HttpUrlUtil.java:30:
> pathString = pathString + "/";
> systests/microprofile/client/jaxrs/src/test/java/org/apache/cxf/systest/microprofile/rest/client/regex/JaxrsPathRegexTest.java:76:
> String endpointAddress = "http://localhost:" + PORT + "/";
> systests/microprofile/client/jaxrs/src/test/java/org/apache/cxf/systest/microprofile/rest/client/regex/JaxrsPathRegexTest.java:121:
> String endpointAddress = "http://localhost:" + PORT + "/";
> systests/uncategorized/src/test/java/org/apache/cxf/systest/transform/feature/TransformFeatureTest.java:95:
> String endpoint = "http://127.0.0.1:" + socket.getLocalPort() + "/";
> tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ModuleToNSMapper.java:108:
> parentURI = parentURI + "/";
--
This message was sent by Atlassian Jira
(v8.20.10#820010)