cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asold...@apache.org
Subject svn commit: r798608 - in /cxf/branches/2.2.x-fixes: ./ rt/core/src/main/java/org/apache/cxf/transport/http/WSDLQueryHandler.java systests/src/test/java/org/apache/cxf/systest/http/WSDLAddressRewriteTest.java
Date Tue, 28 Jul 2009 17:07:05 GMT
Author: asoldano
Date: Tue Jul 28 17:07:05 2009
New Revision: 798608

URL: http://svn.apache.org/viewvc?rev=798608&view=rev
Log:
Merged revisions 798479,798557,798573 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r798479 | asoldano | 2009-07-28 12:18:24 +0200 (mar, 28 lug 2009) | 2 lines
  
  [CXF-2364] Allow SOAP address rewrite in wsdl according to the request call
........
  r798557 | asoldano | 2009-07-28 17:23:32 +0200 (mar, 28 lug 2009) | 2 lines
  
  [CXF-2364] adding check on Service name + providing a testcase
........
  r798573 | asoldano | 2009-07-28 17:44:27 +0200 (mar, 28 lug 2009) | 2 lines
  
  Checkstyle error fix
........


Added:
    cxf/branches/2.2.x-fixes/systests/src/test/java/org/apache/cxf/systest/http/WSDLAddressRewriteTest.java
      - copied unchanged from r798557, cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http/WSDLAddressRewriteTest.java
Modified:
    cxf/branches/2.2.x-fixes/   (props changed)
    cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/http/WSDLQueryHandler.java

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jul 28 17:07:05 2009
@@ -1 +1 @@
-/cxf/trunk:782728-782730,783097,783294,783396,784059,784181-784184,784893,784895,785279-785282,785468,785621,785624,785651,785734,785866,786142,786271-786272,786395,786512,786514,786582-786583,786638,786647,786850,787200,787269,787277-787279,787290-787291,787305,787323,787366,787849,788030,788060,788187,788444,788451,788703,788752,788774,788819-788820,789013,789371,789387,789420,789527-789530,789704-789705,789788,789811,789896-789901,790074,790094,790134,790188,790294,790553,790637-790644,790868,791301,791354,791538,791753,791947,792007,792096,792183,792261-792265,792271,792604,792683-792685,792975,792985,793059,793570,794297,794396,794680,794728,794771,794778-794780,794892,795044,795104,795160,795583,795907,796022-796023,796352,796593,796741,796780,796994-796997,797117,797159,797192,797194,797231-797233,797442,797505,797517,797534,797581-797583,797587,797640,797651,797699,797882-797883,798344-798346,798363,798461,798533,798551,798561-798562,798570,798584
+/cxf/trunk:782728-782730,783097,783294,783396,784059,784181-784184,784893,784895,785279-785282,785468,785621,785624,785651,785734,785866,786142,786271-786272,786395,786512,786514,786582-786583,786638,786647,786850,787200,787269,787277-787279,787290-787291,787305,787323,787366,787849,788030,788060,788187,788444,788451,788703,788752,788774,788819-788820,789013,789371,789387,789420,789527-789530,789704-789705,789788,789811,789896-789901,790074,790094,790134,790188,790294,790553,790637-790644,790868,791301,791354,791538,791753,791947,792007,792096,792183,792261-792265,792271,792604,792683-792685,792975,792985,793059,793570,794297,794396,794680,794728,794771,794778-794780,794892,795044,795104,795160,795583,795907,796022-796023,796352,796593,796741,796780,796994-796997,797117,797159,797192,797194,797231-797233,797442,797505,797517,797534,797581-797583,797587,797640,797651,797699,797882-797883,798344-798346,798363,798461,798479,798533,798551,798557,798561-798562,798570,798573,79858
 4

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/http/WSDLQueryHandler.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/http/WSDLQueryHandler.java?rev=798608&r1=798607&r2=798608&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/http/WSDLQueryHandler.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/http/WSDLQueryHandler.java
Tue Jul 28 17:07:05 2009
@@ -207,7 +207,7 @@
                 doc = XMLUtils.getParser().parse(src);
             }
             
-            updateDoc(doc, base, mp, smp);
+            updateDoc(doc, base, mp, smp, endpointInfo);
             String enc = doc.getXmlEncoding();
             if (enc == null) {
                 enc = "utf-8";
@@ -226,9 +226,10 @@
         }
     }
     
-    private void updateDoc(Document doc, String base,
+    protected void updateDoc(Document doc, String base,
                            Map<String, Definition> mp,
-                           Map<String, SchemaReference> smp) {        
+                           Map<String, SchemaReference> smp,
+                           EndpointInfo ei) {        
         List<Element> elementList = DOMUtils.findAllElementsByTagNameNS(doc.getDocumentElement(),
                                                                        "http://www.w3.org/2001/XMLSchema",
                                                                        "import");
@@ -258,6 +259,33 @@
                 el.setAttribute("location", base + "?wsdl=" + sl);
             }
         }
+        
+        Boolean rewriteSoapAddress = ei.getProperty("autoRewriteSoapAddress", Boolean.class);
+        
+        if (rewriteSoapAddress != null && rewriteSoapAddress.booleanValue()) {
+            List<Element> serviceList = DOMUtils.findAllElementsByTagNameNS(doc.getDocumentElement(),
+                                                              "http://schemas.xmlsoap.org/wsdl/",
+                                                              "service");
+            for (Element serviceEl : serviceList) {
+                String serviceName = serviceEl.getAttribute("name");
+                if (serviceName.equals(ei.getService().getName().getLocalPart())) {
+                    elementList = DOMUtils.findAllElementsByTagNameNS(doc.getDocumentElement(),
+                                                                      "http://schemas.xmlsoap.org/wsdl/",
+                                                                      "port");
+                    for (Element el : elementList) {
+                        String name = el.getAttribute("name");
+                        if (name.equals(ei.getName().getLocalPart())) {
+                            Element soapAddress = DOMUtils.findAllElementsByTagNameNS(el,
+                                                                 "http://schemas.xmlsoap.org/wsdl/soap/",
+                                                                 "address")
+                                                                       .iterator().next();
+                            soapAddress.setAttribute("location", base);
+                        }
+                    }
+                }
+            }
+        }
+        
         doc.setXmlStandalone(true);
     }
 



Mime
View raw message