cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r772704 - in /cxf/branches/2.0.x-fixes: ./ common/common/src/main/java/org/apache/cxf/configuration/spring/ common/common/src/main/java/org/apache/cxf/helpers/ common/common/src/main/java/org/apache/cxf/staxutils/ rt/bindings/http/src/main/...
Date Thu, 07 May 2009 16:51:33 GMT
Author: dkulp
Date: Thu May  7 16:51:21 2009
New Revision: 772704

URL: http://svn.apache.org/viewvc?rev=772704&view=rev
Log:
Merged revisions 772668 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/branches/2.1.x-fixes

................
  r772668 | dkulp | 2009-05-07 10:49:57 -0400 (Thu, 07 May 2009) | 10 lines
  
  Merged revisions 772402 via svnmerge from 
  https://svn.apache.org/repos/asf/cxf/trunk
  
  ........
    r772402 | dkulp | 2009-05-06 14:55:25 -0400 (Wed, 06 May 2009) | 3 lines
    
    [CXF-2205] Fix issues with Aegis trimming strings
    Also fix potential problems with DOMUtils.getContent(..) not returning all the content
  ........
................

Added:
    cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/aegis/ServerPasswordCallback.java
      - copied unchanged from r772668, cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/aegis/ServerPasswordCallback.java
Modified:
    cxf/branches/2.0.x-fixes/   (props changed)
    cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/configuration/spring/StringBeanDefinitionParser.java
    cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/helpers/DOMUtils.java
    cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/W3CDOMStreamReader.java
    cxf/branches/2.0.x-fixes/rt/bindings/http/src/main/java/org/apache/cxf/binding/http/interceptor/URIParameterOutInterceptor.java
    cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/test/XPathAssert.java
    cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BigDecimalType.java
    cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BigIntegerType.java
    cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ByteType.java
    cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/CalendarType.java
    cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/DateTimeType.java
    cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/DateType.java
    cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ObjectType.java
    cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ShortType.java
    cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/TimeType.java
    cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/TimestampType.java
    cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/URIType.java
    cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/DurationType.java
    cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/EnumType.java
    cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/XMLGregorianCalendarType.java
    cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/mtom/AbstractXOPType.java
    cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/AbstractMessageReader.java
    cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/stax/ElementReader.java
    cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWsImpl.java
    cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWsTest.java
    cxf/branches/2.0.x-fixes/systests/src/test/resources/aegisJaxWsBeans.xml

Propchange: cxf/branches/2.0.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu May  7 16:51:21 2009
@@ -1,3 +1,3 @@
-/cxf/branches/2.1.x-fixes:673548,674485,674547,674551,674562,674601,674649,674764,674887,675644,675653,677048,677385,678004,678009,678559,678629,678808,678852,678891,678893,679248,679597,680435,681060,681165,681813,681816,682902,682951,683089,683290,683318,684099,684790-684793,684842,684862,684895-684918,685205,685253,686237,686283,686299,686333-686364,686765,686827,687097,687464-687465,689109,689112,689122,691316,691357,691491,691711,691715,691745,692162-692163,692468,692500,694466-694469,694472,694717,694748-694749,694870,695503,695509,695553,695555,695563,695875-695877,695940,695980,696436,696455,696721,697086,698129,701526,701634,702275,702443,702527,702582,702604,702610,702642-702643,702649,702760,702870,702873,702959,703193,703242,703523,704303,704587,704738,704998,705153,705280-705449,705455,709357,709641,709644,710177,710184,711736,712199,712225,712275,712600,712896,713083,713410,713413,713594,713599,713808,713901,714169-714171,718622,718929,719211,719221-719223,7192
 96,719300-719301,719303,719308,719332,719356,719363,719369-719383,719650,719695,720124,723545,724403-724404,724421,724448,724451,724486-724487,724714,725367,725371,725763,725774,726045,726048,726106,726123,726745-726746,726749,726754,726756-726758,726995,727794,727797-727798,727800,731676,731684,731686-731688,731690,733587,733873,733876,733884,733891,733893,733915,735132,735136,735789,736451,736453,736456,736761,736765,736771,736827,736853,737126,737706,737714,737716,737726,737729-737730,737732,737734,737737,737861,738167,738181,738202,738206,738208,738243,738245,738588-738594,739379,739916,739920-739921,739930,740043,740190,740195,740326,740328,740959,741153-741156,741159,741163,741190,743496,743498-743499,743501-743502,743504,743512,743516,743968,744173,744181,745593,745596,745598,745600,745604-745605,745607,745639,745954,746013,746021-746022,747459,747461-747464,747466,747471,747477,747817,748248,748324,748605,748607-748608,749372,750958,750971,750973,750977,750980,750983
 -750984,750986,750988,751006,751235,751238,751943,751979,752118,752142,752162,752244,752248,752563,752615,752852-752854,752856,752916-752917,752993,757964,757966,757971,757973,758347,758404,759994-759996,760076,760154,760469,761762,761790,762395,764047-764048,764052,764058,764062,764147,764587,764892,766045,766119,766964,767152,767155,767160,767187,772161,772661-772662
-/cxf/trunk:651669-686342,686344-686363,686764,686820,687096,687387,687463,688086,688102,688735,691271,691355,691488,691602,691706,691728,692116,692157,692466,692499,693653,693819,694179,694263,694417,694716,694744,694747,694869,695396,695484,695537,695552,695561,695619,695684,695835,695935,695977,696094,696433,696720,697085,698128,700261,700602,701783,701830,701862,702267,702580,702602,702609,702616,702656,702957,703191,703239,703501,704584,704997,705150,705274,705340,705446,708550,708554,709353-709354,709425,710150,712194,712198,712272,712312,712670,712893,713082,713584,713597,713804,713899,714167-714168,718281,718565,718620,718640,718665,719017,719210,719215-719218,719222,719273,719327-719354,719362,719368,719382,719649,719680,720119-720217,723338,723717-723791,724334-724371,724433-724438,724449,724481,724485,724668,724782,724795,725754,725773,725799,725839,726342,726524,726631,726637,726639,726692,726724,726992,727445,727692,727754,727792,730139,731598,731604,731615,73163
 1,731635,732320,732363,732411,732710,732773,732827,732829,733582,734666,734836,735734,736332,736343,736352,736408,736423,736491,736738,736766,736825,736852,737032,737069,737124,737237,737299,737356,737494,737498,737855,738166,738178,738201,738242,738244,739367,739799-739800,739876-739877,739922,739937,740154,740186,740197,740255,740810,740844,740886,740902,740923,741124,741152,741188,741521,741529,741879,743087,743439,743441,743446,743459,743469,743965,743967,744175,744195,744756,745214,745243,745560,745578,745586,745638,745950,746012,746019-746020,746306,746357,746373-746374,747217,747386,747406,747454,747766,748223,748305,748313,748603-748604,748768,749511,749584,749767,749771,749890,750059-750060,750591,750689,750935,751067-751110,751233,751740,751787,751828,751840,752122,752132,752136,752558,752613,752680,752728,752753,752849,752880-752881,752992,754585,755365,757859,757899,758308,759963-759964,759966,760073,760150,760468,761759,761789,762393,763272,763495,763931,764034,
 764581,764887,766013,766101,766860,766962-766963,767159,767927,771416,772143
+/cxf/branches/2.1.x-fixes:673548,674485,674547,674551,674562,674601,674649,674764,674887,675644,675653,677048,677385,678004,678009,678559,678629,678808,678852,678891,678893,679248,679597,680435,681060,681165,681813,681816,682902,682951,683089,683290,683318,684099,684790-684793,684842,684862,684895-684918,685205,685253,686237,686283,686299,686333-686364,686765,686827,687097,687464-687465,689109,689112,689122,691316,691357,691491,691711,691715,691745,692162-692163,692468,692500,694466-694469,694472,694717,694748-694749,694870,695503,695509,695553,695555,695563,695875-695877,695940,695980,696436,696455,696721,697086,698129,701526,701634,702275,702443,702527,702582,702604,702610,702642-702643,702649,702760,702870,702873,702959,703193,703242,703523,704303,704587,704738,704998,705153,705280-705449,705455,709357,709641,709644,710177,710184,711736,712199,712225,712275,712600,712896,713083,713410,713413,713594,713599,713808,713901,714169-714171,718622,718929,719211,719221-719223,7192
 96,719300-719301,719303,719308,719332,719356,719363,719369-719383,719650,719695,720124,723545,724403-724404,724421,724448,724451,724486-724487,724714,725367,725371,725763,725774,726045,726048,726106,726123,726745-726746,726749,726754,726756-726758,726995,727794,727797-727798,727800,731676,731684,731686-731688,731690,733587,733873,733876,733884,733891,733893,733915,735132,735136,735789,736451,736453,736456,736761,736765,736771,736827,736853,737126,737706,737714,737716,737726,737729-737730,737732,737734,737737,737861,738167,738181,738202,738206,738208,738243,738245,738588-738594,739379,739916,739920-739921,739930,740043,740190,740195,740326,740328,740959,741153-741156,741159,741163,741190,743496,743498-743499,743501-743502,743504,743512,743516,743968,744173,744181,745593,745596,745598,745600,745604-745605,745607,745639,745954,746013,746021-746022,747459,747461-747464,747466,747471,747477,747817,748248,748324,748605,748607-748608,749372,750958,750971,750973,750977,750980,750983
 -750984,750986,750988,751006,751235,751238,751943,751979,752118,752142,752162,752244,752248,752563,752615,752852-752854,752856,752916-752917,752993,757964,757966,757971,757973,758347,758404,759994-759996,760076,760154,760469,761762,761790,762395,764047-764048,764052,764058,764062,764147,764587,764892,766045,766119,766964,767152,767155,767160,767187,772161,772661-772662,772668
+/cxf/trunk:651669-686342,686344-686363,686764,686820,687096,687387,687463,688086,688102,688735,691271,691355,691488,691602,691706,691728,692116,692157,692466,692499,693653,693819,694179,694263,694417,694716,694744,694747,694869,695396,695484,695537,695552,695561,695619,695684,695835,695935,695977,696094,696433,696720,697085,698128,700261,700602,701783,701830,701862,702267,702580,702602,702609,702616,702656,702957,703191,703239,703501,704584,704997,705150,705274,705340,705446,708550,708554,709353-709354,709425,710150,712194,712198,712272,712312,712670,712893,713082,713584,713597,713804,713899,714167-714168,718281,718565,718620,718640,718665,719017,719210,719215-719218,719222,719273,719327-719354,719362,719368,719382,719649,719680,720119-720217,723338,723717-723791,724334-724371,724433-724438,724449,724481,724485,724668,724782,724795,725754,725773,725799,725839,726342,726524,726631,726637,726639,726692,726724,726992,727445,727692,727754,727792,730139,731598,731604,731615,73163
 1,731635,732320,732363,732411,732710,732773,732827,732829,733582,734666,734836,735734,736332,736343,736352,736408,736423,736491,736738,736766,736825,736852,737032,737069,737124,737237,737299,737356,737494,737498,737855,738166,738178,738201,738242,738244,739367,739799-739800,739876-739877,739922,739937,740154,740186,740197,740255,740810,740844,740886,740902,740923,741124,741152,741188,741521,741529,741879,743087,743439,743441,743446,743459,743469,743965,743967,744175,744195,744756,745214,745243,745560,745578,745586,745638,745950,746012,746019-746020,746306,746357,746373-746374,747217,747386,747406,747454,747766,748223,748305,748313,748603-748604,748768,749511,749584,749767,749771,749890,750059-750060,750591,750689,750935,751067-751110,751233,751740,751787,751828,751840,752122,752132,752136,752558,752613,752680,752728,752753,752849,752880-752881,752992,754585,755365,757859,757899,758308,759963-759964,759966,760073,760150,760468,761759,761789,762393,763272,763495,763931,764034,
 764581,764887,766013,766101,766860,766962-766963,767159,767927,771416,772143,772402
 /incubator/cxf/trunk:434594-651668

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

Modified: cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/configuration/spring/StringBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/configuration/spring/StringBeanDefinitionParser.java?rev=772704&r1=772703&r2=772704&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/configuration/spring/StringBeanDefinitionParser.java
(original)
+++ cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/configuration/spring/StringBeanDefinitionParser.java
Thu May  7 16:51:21 2009
@@ -28,7 +28,7 @@
 
     @Override
     protected void doParse(Element element, BeanDefinitionBuilder builder) {
-        builder.addConstructorArg(DOMUtils.getContent(element));
+        builder.addConstructorArg(DOMUtils.getRawContent(element));
     }
 
     @Override

Modified: cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/helpers/DOMUtils.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/helpers/DOMUtils.java?rev=772704&r1=772703&r2=772704&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/helpers/DOMUtils.java
(original)
+++ cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/helpers/DOMUtils.java
Thu May  7 16:51:21 2009
@@ -46,6 +46,7 @@
 import org.w3c.dom.Element;
 import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Node;
+import org.w3c.dom.Text;
 
 import org.xml.sax.EntityResolver;
 import org.xml.sax.InputSource;
@@ -93,17 +94,11 @@
      * Get the trimmed text content of a node or null if there is no text
      */
     public static String getContent(Node n) {
-        if (n == null) {
-            return null;
+        String s = getRawContent(n);
+        if (s != null) {
+            s = s.trim();
         }
-
-        Node n1 = DOMUtils.getChild(n, Node.TEXT_NODE);
-
-        if (n1 == null) {
-            return null;
-        }
-
-        return n1.getNodeValue().trim();
+        return s;
     }
 
     /**
@@ -113,14 +108,26 @@
         if (n == null) {
             return null;
         }
-
-        Node n1 = DOMUtils.getChild(n, Node.TEXT_NODE);
-
-        if (n1 == null) {
-            return null;
+        StringBuilder b = null;
+        String s = null;
+        Node n1 = n.getFirstChild();
+        while (n1 != null) {
+            if (n1.getNodeType() == Node.TEXT_NODE) {
+                if (b != null) {
+                    b.append(((Text)n1).getNodeValue());
+                } else if (s == null) {
+                    s = ((Text)n1).getNodeValue();
+                } else {
+                    b = new StringBuilder(s);
+                    s = null;
+                }
+            }
+            n1 = n1.getNextSibling();
         }
-
-        return n1.getNodeValue();
+        if (b != null) {
+            return b.toString();
+        }
+        return s;
     }
 
     /**
@@ -234,7 +241,7 @@
             // System.out.println("getNode: " + name + " " +
             // node.getNodeName());
             if (name.equals(node.getNodeName())) {
-                return getContent(node);
+                return getRawContent(node);
             }
         }
         return null;

Modified: cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/W3CDOMStreamReader.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/W3CDOMStreamReader.java?rev=772704&r1=772703&r2=772704&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/W3CDOMStreamReader.java
(original)
+++ cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/W3CDOMStreamReader.java
Thu May  7 16:51:21 2009
@@ -175,7 +175,7 @@
 
     @Override
     public String getElementText() throws XMLStreamException {
-        String result = DOMUtils.getContent(content);
+        String result = DOMUtils.getRawContent(content);
 
         ElementFrame<Node, Node> frame = getCurrentFrame();
         frame.ended = true;
@@ -216,8 +216,7 @@
         if (at == null) {
             return null;
         }
-
-        return DOMUtils.getContent(at);
+        return at.getNodeValue();
     }
 
     public int getAttributeCount() {

Modified: cxf/branches/2.0.x-fixes/rt/bindings/http/src/main/java/org/apache/cxf/binding/http/interceptor/URIParameterOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/bindings/http/src/main/java/org/apache/cxf/binding/http/interceptor/URIParameterOutInterceptor.java?rev=772704&r1=772703&r2=772704&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/bindings/http/src/main/java/org/apache/cxf/binding/http/interceptor/URIParameterOutInterceptor.java
(original)
+++ cxf/branches/2.0.x-fixes/rt/bindings/http/src/main/java/org/apache/cxf/binding/http/interceptor/URIParameterOutInterceptor.java
Thu May  7 16:51:21 2009
@@ -92,7 +92,7 @@
                     Node node = root.getFirstChild();
                     while (node != null) {
                         if (node.getNodeType() == Node.ELEMENT_NODE && name.equals(node.getLocalName()))
{
-                            builder.append(DOMUtils.getContent(node));
+                            builder.append(DOMUtils.getRawContent(node));
                             break;
                         }   
                         node = node.getNextSibling();

Modified: cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/test/XPathAssert.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/test/XPathAssert.java?rev=772704&r1=772703&r2=772704&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/test/XPathAssert.java (original)
+++ cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/test/XPathAssert.java Thu
May  7 16:51:21 2009
@@ -118,7 +118,7 @@
             throw new AssertionFailedError("No nodes were found for expression: " + xpath);
         }
 
-        String value2 = DOMUtils.getContent(result).trim();
+        String value2 = DOMUtils.getContent(result);
 
         Assert.assertEquals(value, value2);
     }

Modified: cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BigDecimalType.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BigDecimalType.java?rev=772704&r1=772703&r2=772704&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BigDecimalType.java
(original)
+++ cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BigDecimalType.java
Thu May  7 16:51:21 2009
@@ -39,7 +39,7 @@
     public Object readObject(final MessageReader reader, final Context context) {
         final String value = reader.getValue();
 
-        return null == value ? null : new BigDecimal(value);
+        return null == value ? null : new BigDecimal(value.trim());
     }
 
     @Override

Modified: cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BigIntegerType.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BigIntegerType.java?rev=772704&r1=772703&r2=772704&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BigIntegerType.java
(original)
+++ cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BigIntegerType.java
Thu May  7 16:51:21 2009
@@ -39,7 +39,7 @@
     public Object readObject(final MessageReader reader, final Context context) {
         final String value = reader.getValue();
 
-        return null == value ? null : new BigInteger(value);
+        return null == value ? null : new BigInteger(value.trim());
     }
 
     @Override

Modified: cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ByteType.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ByteType.java?rev=772704&r1=772703&r2=772704&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ByteType.java
(original)
+++ cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ByteType.java
Thu May  7 16:51:21 2009
@@ -35,7 +35,7 @@
 
     @Override
     public Object readObject(MessageReader reader, Context context) {
-        return new Byte(reader.getValue());
+        return new Byte(reader.getValue().trim());
     }
 
     @Override

Modified: cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/CalendarType.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/CalendarType.java?rev=772704&r1=772703&r2=772704&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/CalendarType.java
(original)
+++ cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/CalendarType.java
Thu May  7 16:51:21 2009
@@ -44,7 +44,7 @@
         }
 
         try {
-            return format.parseObject(value);
+            return format.parseObject(value.trim());
         } catch (ParseException e) {
             throw new DatabindingException("Could not parse xs:dateTime: " + e.getMessage(),
e);
         }

Modified: cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/DateTimeType.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/DateTimeType.java?rev=772704&r1=772703&r2=772704&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/DateTimeType.java
(original)
+++ cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/DateTimeType.java
Thu May  7 16:51:21 2009
@@ -51,7 +51,7 @@
         }
 
         try {
-            return ((Calendar)format.parseObject(value)).getTime();
+            return ((Calendar)format.parseObject(value.trim())).getTime();
         } catch (ParseException e) {
             throw new DatabindingException("Could not parse xs:dateTime: " + e.getMessage(),
e);
         }

Modified: cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/DateType.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/DateType.java?rev=772704&r1=772703&r2=772704&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/DateType.java
(original)
+++ cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/DateType.java
Thu May  7 16:51:21 2009
@@ -47,7 +47,7 @@
         }
 
         try {
-            return ((Calendar)format.parseObject(value)).getTime();
+            return ((Calendar)format.parseObject(value.trim())).getTime();
         } catch (ParseException e) {
             throw new DatabindingException("Could not parse xs:dat: " + e.getMessage(), e);
         }

Modified: cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ObjectType.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ObjectType.java?rev=772704&r1=772703&r2=772704&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ObjectType.java
(original)
+++ cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ObjectType.java
Thu May  7 16:51:21 2009
@@ -99,6 +99,7 @@
             throw new DatabindingException("Missing 'xsi:type' attribute value");
         }
 
+        typeName = typeName.trim();
         Type type = null;
         QName typeQName = null;
         if (typeName != null) {
@@ -152,7 +153,8 @@
     private Object reconstituteJavaObject(MessageReader reader) throws DatabindingException
{
 
         try {
-            ByteArrayInputStream in = new ByteArrayInputStream(Base64Utility.decode(reader.getValue()));
+            ByteArrayInputStream in = new ByteArrayInputStream(Base64Utility
+                                                                   .decode(reader.getValue().trim()));
             return new ObjectInputStream(in).readObject();
         } catch (Exception e) {
             throw new DatabindingException("Unable to reconstitute serialized object", e);
@@ -160,7 +162,7 @@
     }
 
     private boolean isNil(MessageReader reader) {
-        return null != reader && "true".equals(reader.getValue());
+        return null != reader && "true".equals(reader.getValue() == null ? "" : reader.getValue());
     }
 
     @Override

Modified: cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ShortType.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ShortType.java?rev=772704&r1=772703&r2=772704&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ShortType.java
(original)
+++ cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ShortType.java
Thu May  7 16:51:21 2009
@@ -29,7 +29,7 @@
 public class ShortType extends Type {
     @Override
     public Object readObject(MessageReader reader, Context context) {
-        return new Short(reader.getValue());
+        return new Short(reader.getValue().trim());
     }
 
     @Override

Modified: cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/TimeType.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/TimeType.java?rev=772704&r1=772703&r2=772704&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/TimeType.java
(original)
+++ cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/TimeType.java
Thu May  7 16:51:21 2009
@@ -46,7 +46,7 @@
         }
 
         try {
-            Calendar c = (Calendar)format.parseObject(value);
+            Calendar c = (Calendar)format.parseObject(value.trim());
             return new Time(c.getTimeInMillis());
         } catch (ParseException e) {
             throw new DatabindingException("Could not parse xs:dateTime: " + e.getMessage(),
e);

Modified: cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/TimestampType.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/TimestampType.java?rev=772704&r1=772703&r2=772704&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/TimestampType.java
(original)
+++ cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/TimestampType.java
Thu May  7 16:51:21 2009
@@ -46,7 +46,7 @@
         }
 
         try {
-            Calendar c = (Calendar)format.parseObject(value);
+            Calendar c = (Calendar)format.parseObject(value.trim());
             return new Timestamp(c.getTimeInMillis());
         } catch (ParseException e) {
             throw new DatabindingException("Could not parse xs:dateTime: " + e.getMessage(),
e);

Modified: cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/URIType.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/URIType.java?rev=772704&r1=772703&r2=772704&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/URIType.java
(original)
+++ cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/URIType.java
Thu May  7 16:51:21 2009
@@ -35,7 +35,7 @@
     public Object readObject(final MessageReader reader, final Context context) {
         final String value = reader.getValue();
 
-        return null == value ? null : URI.create(value);
+        return null == value ? null : URI.create(value.trim());
     }
 
     @Override

Modified: cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/DurationType.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/DurationType.java?rev=772704&r1=772703&r2=772704&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/DurationType.java
(original)
+++ cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/DurationType.java
Thu May  7 16:51:21 2009
@@ -46,7 +46,7 @@
 
     @Override
     public Object readObject(MessageReader reader, Context context) {
-        return dtFactory.newDuration(reader.getValue());
+        return dtFactory.newDuration(reader.getValue().trim());
     }
 
     @Override

Modified: cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/EnumType.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/EnumType.java?rev=772704&r1=772703&r2=772704&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/EnumType.java
(original)
+++ cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/EnumType.java
Thu May  7 16:51:21 2009
@@ -34,7 +34,7 @@
     public Object readObject(MessageReader reader, Context context) {
         String value = reader.getValue();
 
-        return Enum.valueOf(getTypeClass(), value);
+        return Enum.valueOf(getTypeClass(), value.trim());
     }
 
     @Override

Modified: cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/XMLGregorianCalendarType.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/XMLGregorianCalendarType.java?rev=772704&r1=772703&r2=772704&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/XMLGregorianCalendarType.java
(original)
+++ cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/XMLGregorianCalendarType.java
Thu May  7 16:51:21 2009
@@ -46,7 +46,7 @@
 
     @Override
     public Object readObject(MessageReader reader, Context context) {
-        return dtFactory.newXMLGregorianCalendar(reader.getValue());
+        return dtFactory.newXMLGregorianCalendar(reader.getValue().trim());
     }
 
     @Override

Modified: cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/mtom/AbstractXOPType.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/mtom/AbstractXOPType.java?rev=772704&r1=772703&r2=772704&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/mtom/AbstractXOPType.java
(original)
+++ cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/mtom/AbstractXOPType.java
Thu May  7 16:51:21 2009
@@ -52,7 +52,7 @@
             MessageReader child = reader.getNextElementReader();
             if (child.getName().equals(XOP_INCLUDE)) {
                 MessageReader mimeReader = child.getAttributeReader(XOP_HREF);
-                String type = mimeReader.getValue();
+                String type = mimeReader.getValue().trim();
                 o = readInclude(type, child, context);
             }
             child.readToEnd();
@@ -63,7 +63,7 @@
 
     public Object readInclude(String type, MessageReader reader,
                               Context context) throws DatabindingException {
-        String href = reader.getAttributeReader(XOP_HREF).getValue();
+        String href = reader.getAttributeReader(XOP_HREF).getValue().trim();
 
         Attachment att = AttachmentUtil.getAttachment(href, context.getAttachments());
 

Modified: cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/AbstractMessageReader.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/AbstractMessageReader.java?rev=772704&r1=772703&r2=772704&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/AbstractMessageReader.java
(original)
+++ cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/AbstractMessageReader.java
Thu May  7 16:51:21 2009
@@ -50,7 +50,7 @@
         boolean nil = false;
         if (nilReader != null) {
             String value = nilReader.getValue();
-            if (value != null && (value.equals("true") || value.equals("1"))) {
+            if (value != null && (value.trim().equals("true") || value.trim().equals("1")))
{
                 return true;
             }
         }
@@ -77,7 +77,7 @@
             return 0;
         }
 
-        return Integer.parseInt(getValue());
+        return Integer.parseInt(getValue().trim());
     }
 
     /**
@@ -88,7 +88,7 @@
             return 0L;
         }
 
-        return Long.parseLong(getValue());
+        return Long.parseLong(getValue().trim());
     }
 
     /**
@@ -99,7 +99,7 @@
             return 0d;
         }
 
-        return Double.parseDouble(getValue());
+        return Double.parseDouble(getValue().trim());
     }
 
     /**
@@ -110,7 +110,7 @@
             return 0f;
         }
 
-        return Float.parseFloat(getValue());
+        return Float.parseFloat(getValue().trim());
     }
 
     /**
@@ -121,7 +121,7 @@
         if (value == null) {
             return false;
         }
-
+        value = value.trim();
         if ("true".equalsIgnoreCase(value) || "1".equalsIgnoreCase(value)) {
             return true;
         }

Modified: cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/stax/ElementReader.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/stax/ElementReader.java?rev=772704&r1=772703&r2=772704&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/stax/ElementReader.java
(original)
+++ cxf/branches/2.0.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/stax/ElementReader.java
Thu May  7 16:51:21 2009
@@ -141,8 +141,6 @@
             
             if (value == null) {
                 value = "";
-            } else {
-                value = value.trim();
             }
         }
         return value;

Modified: cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWsImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWsImpl.java?rev=772704&r1=772703&r2=772704&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWsImpl.java
(original)
+++ cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWsImpl.java
Thu May  7 16:51:21 2009
@@ -47,7 +47,7 @@
     public Item getItemByKey(String key1, String key2) {
         Item fake = new Item();
         fake.setKey(new Integer(33));
-        fake.setData("and a third");
+        fake.setData(key1 + ":" + key2);
         return fake;
     }
     

Modified: cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWsTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWsTest.java?rev=772704&r1=772703&r2=772704&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWsTest.java
(original)
+++ cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWsTest.java
Thu May  7 16:51:21 2009
@@ -19,12 +19,15 @@
 
 package org.apache.cxf.systest.aegis;
 
+import java.util.HashMap;
 import java.util.Map;
 import java.util.Map.Entry;
 
 import org.apache.cxf.aegis.databinding.AegisDatabinding;
 import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
 import org.apache.cxf.systest.aegis.bean.Item;
+import org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor;
+
 import org.junit.Test;
 import org.springframework.test.AbstractDependencyInjectionSpringContextTests;
 
@@ -43,26 +46,46 @@
         return new String[] {"classpath:aegisJaxWsBeans.xml"};
     }
     
-    private void setupForTest() throws Exception {
+    private void setupForTest(boolean sec) throws Exception {
         
         JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
         factory.setServiceClass(AegisJaxWs.class);
-        factory.setAddress("http://localhost:9167/aegisJaxWs");
+        if (sec) {
+            factory.setAddress("http://localhost:9167/aegisJaxWsUN");
+            WSS4JOutInterceptor wss4jOut = new WSS4JOutInterceptor();
+            wss4jOut.setProperty("action", "UsernameToken");
+            wss4jOut.setProperty("user", "alice");
+            wss4jOut.setProperty("password", "pass");
+            
+            factory.setProperties(new HashMap<String, Object>());
+            factory.getProperties().put("password", "pass");
+            factory.getOutInterceptors().add(wss4jOut);
+        } else {
+            factory.setAddress("http://localhost:9167/aegisJaxWs");            
+        }
         factory.getServiceFactory().setDataBinding(new AegisDatabinding());
 
         client = (AegisJaxWs)factory.create();
     }
     
     @Test
-    public void testGetItem() throws Exception {
-        setupForTest();
-        Item item = client.getItemByKey("a", "b");
+    public void testGetItemSecure() throws Exception {
+        setupForTest(true);
+        Item item = client.getItemByKey("   jack&jill   ", "b");
         assertEquals(33, item.getKey().intValue());
+        assertEquals("   jack&jill   :b", item.getData());
     }
     
+    @Test
+    public void testGetItem() throws Exception {
+        setupForTest(false);
+        Item item = client.getItemByKey(" a ", "b");
+        assertEquals(33, item.getKey().intValue());
+        assertEquals(" a :b", item.getData());
+    }
     @Test 
     public void testMapSpecified() throws Exception {
-        setupForTest();
+        setupForTest(false);
         Item item = new Item();
         item.setKey(new Integer(42));
         item.setData("Godzilla");
@@ -78,4 +101,5 @@
         assertEquals(42, key2.intValue());
         assertEquals("Godzilla", item2.getData());
     }
+    
 }

Modified: cxf/branches/2.0.x-fixes/systests/src/test/resources/aegisJaxWsBeans.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/systests/src/test/resources/aegisJaxWsBeans.xml?rev=772704&r1=772703&r2=772704&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/systests/src/test/resources/aegisJaxWsBeans.xml (original)
+++ cxf/branches/2.0.x-fixes/systests/src/test/resources/aegisJaxWsBeans.xml Thu May  7 16:51:21
2009
@@ -60,4 +60,33 @@
 				class="org.apache.cxf.binding.soap.saaj.SAAJInInterceptor" />
 		</jaxws:inInterceptors>
 	</jaxws:endpoint>
+	
+	
+	<bean id="myPasswordCallback"
+		class="org.apache.cxf.systest.aegis.ServerPasswordCallback"/>
+	
+	<jaxws:endpoint id="aegisRPCImplUN" implementor="#impl"
+		address="http://localhost:9167/aegisJaxWsUN">
+		<jaxws:serviceFactory>
+			<ref bean='jaxws-and-aegis-service-factory' />
+		</jaxws:serviceFactory>
+		
+		<jaxws:inInterceptors>
+  			<bean class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
+	     		<constructor-arg>
+	        		<map>
+	           			<entry key="action" value="UsernameToken"/>
+	           			<entry key="passwordType" value="PasswordText"/>
+	           			<entry key="passwordCallbackRef">
+	             			 <ref bean="myPasswordCallback"/>
+	           			</entry>
+	       			</map>
+	     		</constructor-arg>
+ 			</bean>
+		</jaxws:inInterceptors>
+
+		<jaxws:properties>
+		  <entry key="mtom-enabled" value="true" />
+		</jaxws:properties>
+	</jaxws:endpoint>
 </beans>
\ No newline at end of file



Mime
View raw message