You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by re...@apache.org on 2024/05/09 12:11:12 UTC

(cxf) 05/07: Use URI factory to parse WSDL location (#1858)

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

reta pushed a commit to branch 4.0.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit 2d1dbd8a9a3dd602653cd7bf7f0106e97fe2e5cd
Author: Francisco Mateo <ci...@users.noreply.github.com>
AuthorDate: Thu May 9 06:33:19 2024 -0500

    Use URI factory to parse WSDL location (#1858)
    
    (cherry picked from commit 17d58fb7671f24919f852bbefce739ca36f6e763)
---
 .../org/apache/cxf/tools/wsdlto/frontend/jaxws/template/service.vm     | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/service.vm b/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/service.vm
index a57e420324..2d1b969f3e 100644
--- a/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/service.vm
+++ b/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/service.vm
@@ -24,6 +24,7 @@ package $service.PackageName;
 #if ($wsdlLocation != "" && not($useGetResource) && not($wsdlLocation.startsWith("classpath:")))
 import java.net.MalformedURLException;
 #end
+import java.net.URI;
 import java.net.URL;
 #if ($markGenerated == "true")
 import jakarta.annotation.Generated;
@@ -120,7 +121,7 @@ public class ${service.Name} extends ${serviceSuperclass} {
 #else
         URL url = null;
         try {
-            url = new URL("$wsdlLocation");
+            url = URI.create("$wsdlLocation").toURL();
         } catch (MalformedURLException e) {
 #if ($serviceTarget == "cxf")
             LogUtils.getL7dLogger(${service.Name}.class)