cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r798574 - in /cxf/branches/2.2.x-fixes: ./ rt/core/src/main/java/org/apache/cxf/interceptor/WrappedOutInterceptor.java
Date Tue, 28 Jul 2009 15:45:08 GMT
Author: dkulp
Date: Tue Jul 28 15:45:08 2009
New Revision: 798574

URL: http://svn.apache.org/viewvc?rev=798574&view=rev
Log:
Merged revisions 798551 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r798551 | dkulp | 2009-07-28 10:54:47 -0400 (Tue, 28 Jul 2009) | 1 line
  
  Use the databinding ns map if available
........

Modified:
    cxf/branches/2.2.x-fixes/   (props changed)
    cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedOutInterceptor.java

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jul 28 15:45:08 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
+/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

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/interceptor/WrappedOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedOutInterceptor.java?rev=798574&r1=798573&r2=798574&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedOutInterceptor.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedOutInterceptor.java
Tue Jul 28 15:45:08 2009
@@ -28,6 +28,7 @@
 import org.apache.cxf.common.i18n.BundleUtils;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.phase.Phase;
+import org.apache.cxf.service.Service;
 import org.apache.cxf.service.model.BindingOperationInfo;
 import org.apache.cxf.service.model.MessageInfo;
 import org.apache.cxf.service.model.MessagePartInfo;
@@ -62,14 +63,21 @@
             QName name = part.getConcreteName();
 
             try {
-                
-                int x = 1;
-                while (xmlWriter.getNamespaceContext().getNamespaceURI("ns" + x) != null)
{
-                    x++;
+                String pfx = null;
+                Service service = message.getExchange().get(Service.class);
+                if (service.getDataBinding().getDeclaredNamespaceMappings() != null) {
+                    pfx = service.getDataBinding().getDeclaredNamespaceMappings().get(name.getNamespaceURI());
                 }
-                xmlWriter.setPrefix("ns" + x, name.getNamespaceURI());
-                xmlWriter.writeStartElement("ns" + x, name.getLocalPart(), name.getNamespaceURI());
-                xmlWriter.writeNamespace("ns" + x, name.getNamespaceURI());
+                if (pfx == null) {
+                    int x = 1;
+                    while (xmlWriter.getNamespaceContext().getNamespaceURI("ns" + x) != null)
{
+                        x++;
+                    }
+                    pfx = "ns" + x;
+                }
+                xmlWriter.setPrefix(pfx, name.getNamespaceURI());
+                xmlWriter.writeStartElement(pfx, name.getLocalPart(), name.getNamespaceURI());
+                xmlWriter.writeNamespace(pfx, name.getNamespaceURI());
             } catch (XMLStreamException e) {
                 throw new Fault(new org.apache.cxf.common.i18n.Message("STAX_WRITE_EXC",
BUNDLE), e);
             }



Mime
View raw message