You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Mark Kahl (Jira)" <ji...@apache.org> on 2023/06/27 14:06:00 UTC

[jira] [Updated] (CXF-8893) Hard coded slashes at the end of SOAP namespaces are not always appreciated

     [ https://issues.apache.org/jira/browse/CXF-8893?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Kahl updated CXF-8893:
---------------------------
    Description: 
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 + "/";

  was:
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 + "/";


> 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)