You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2026/07/09 12:38:33 UTC

(cxf) branch coheigea/epr-uri created (now e0985a6c77d)

This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a change to branch coheigea/epr-uri
in repository https://gitbox.apache.org/repos/asf/cxf.git


      at e0985a6c77d Plug URIResolver into EndpointReferenceUtils

This branch includes the following new commits:

     new e0985a6c77d Plug URIResolver into EndpointReferenceUtils

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(cxf) 01/01: Plug URIResolver into EndpointReferenceUtils

Posted by co...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch coheigea/epr-uri
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit e0985a6c77d8fcd6b6215b21a651deea1243a22a
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Thu Jul 9 13:38:05 2026 +0100

    Plug URIResolver into EndpointReferenceUtils
---
 .../cxf/ws/addressing/EndpointReferenceUtils.java     | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/core/src/main/java/org/apache/cxf/ws/addressing/EndpointReferenceUtils.java b/core/src/main/java/org/apache/cxf/ws/addressing/EndpointReferenceUtils.java
index d6bf974f51f..90bb8bc9230 100644
--- a/core/src/main/java/org/apache/cxf/ws/addressing/EndpointReferenceUtils.java
+++ b/core/src/main/java/org/apache/cxf/ws/addressing/EndpointReferenceUtils.java
@@ -20,7 +20,6 @@
 package org.apache.cxf.ws.addressing;
 
 import java.io.ByteArrayInputStream;
-import java.io.InputStream;
 import java.lang.ref.Reference;
 import java.lang.ref.SoftReference;
 import java.net.MalformedURLException;
@@ -72,6 +71,7 @@ import org.apache.cxf.helpers.IOUtils;
 import org.apache.cxf.helpers.LoadingByteArrayOutputStream;
 import org.apache.cxf.resource.ExtendedURIResolver;
 import org.apache.cxf.resource.ResourceManager;
+import org.apache.cxf.resource.URIResolver;
 import org.apache.cxf.service.model.SchemaInfo;
 import org.apache.cxf.service.model.ServiceInfo;
 import org.apache.cxf.staxutils.StaxUtils;
@@ -550,20 +550,17 @@ public final class EndpointReferenceUtils {
                         && !schemaSourcesMap.containsKey(sch.getSourceURI() + ':'
                                                          + sch.getTargetNamespace())) {
 
-                        InputStream ins = null;
-                        try {
-                            URL url = new URL(sch.getSourceURI());
-                            ins = url.openStream();
+                        LoadingByteArrayOutputStream out = new LoadingByteArrayOutputStream();
+                        try (URIResolver resolver = new URIResolver(sch.getSourceURI())) {
+                            if (resolver.getInputStream() == null) {
+                                sch.write(out);
+                            } else {
+                                IOUtils.copyAndCloseInput(resolver.getInputStream(), out);
+                            }
                         } catch (Exception e) {
                             //ignore, we'll just use what we have.  (though
                             //bugs in XmlSchema could make this less useful)
-                        }
-
-                        LoadingByteArrayOutputStream out = new LoadingByteArrayOutputStream();
-                        if (ins == null) {
                             sch.write(out);
-                        } else {
-                            IOUtils.copyAndCloseInput(ins, out);
                         }
 
                         schemaSourcesMap.put(sch.getSourceURI() + ':'