cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject cxf git commit: Adding some tests for comments in signed requests
Date Mon, 12 Jan 2015 11:22:17 GMT
Repository: cxf
Updated Branches:
  refs/heads/master a60f73939 -> 3cefd6f30


Adding some tests for comments in signed requests


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/3cefd6f3
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/3cefd6f3
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/3cefd6f3

Branch: refs/heads/master
Commit: 3cefd6f30d85fdab53a105463528bd868bd182b4
Parents: a60f739
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Mon Jan 12 11:21:56 2015 +0000
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Mon Jan 12 11:21:56 2015 +0000

----------------------------------------------------------------------
 .../ws/action/SignatureWhitespaceTest.java      | 30 ++++++++++++++++++++
 .../systest/ws/action/request-with-comment.xml  | 11 +++++++
 2 files changed, 41 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/3cefd6f3/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/action/SignatureWhitespaceTest.java
----------------------------------------------------------------------
diff --git a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/action/SignatureWhitespaceTest.java
b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/action/SignatureWhitespaceTest.java
index 5655342..f4de930 100644
--- a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/action/SignatureWhitespaceTest.java
+++ b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/action/SignatureWhitespaceTest.java
@@ -111,4 +111,34 @@ public class SignatureWhitespaceTest extends AbstractBusClientServerTestBase
{
         StreamSource response = dispatch.invoke(request);
         assertNotNull(response);
     }
+    
+    @org.junit.Test
+    public void testAddedCommentsInSOAPBody() throws Exception {
+        SpringBusFactory bf = new SpringBusFactory();
+        URL busFile = SignatureWhitespaceTest.class.getResource("client.xml");
+
+        Bus bus = bf.createBus(busFile.toString());
+        SpringBusFactory.setDefaultBus(bus);
+        SpringBusFactory.setThreadDefaultBus(bus);
+        
+        URL wsdl = SignatureWhitespaceTest.class.getResource("DoubleItAction.wsdl");
+        Service service = Service.create(wsdl, SERVICE_QNAME);
+        QName portQName = new QName(NAMESPACE, "DoubleItSignaturePort2");
+
+        Dispatch<StreamSource> dispatch = 
+            service.createDispatch(portQName, StreamSource.class, Service.Mode.MESSAGE);
+        
+        // Creating a DOMSource Object for the request
+        
+        URL requestFile = 
+            SignatureWhitespaceTest.class.getResource("request-with-comment.xml");
+        
+        StreamSource request = new StreamSource(new File(requestFile.getPath()));
+
+        updateAddressPort(dispatch, PORT);
+        
+        // Make a successful request
+        StreamSource response = dispatch.invoke(request);
+        assertNotNull(response);
+    }
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/3cefd6f3/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/action/request-with-comment.xml
----------------------------------------------------------------------
diff --git a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/action/request-with-comment.xml
b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/action/request-with-comment.xml
new file mode 100644
index 0000000..ca4a27f
--- /dev/null
+++ b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/action/request-with-comment.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<soap:Envelope xmlns:doub="http://www.example.org/schema/DoubleIt" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
+   <soap:Header><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><wsse:BinarySecurityToken
EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary"
ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509PKIPathv1"
wsu:Id="X509-20518CC1C45561BA3A139904923417216">MIIENzCCAhUwggF+oAMCAQICBElUYAAwDQYJKoZIhvcNAQEFBQAwMzETMBEGA1UEChMKYXBhY2hlLm9yZzEMMAoGA1UECxMDZW5nMQ4wDAYDVQQDEwVjeGZjYTAeFw03MDAxMDEwMDAwMDBaFw0zODAxMTkwMzE0MDdaMDMxEzARBgNVBAoTCmFwYWNoZS5vcmcxDDAKBgNVBAsTA2VuZzEOMAwGA1UEAxMFY3hmY2EwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAOGBi9p1BUVpWm17gmjZTo6QkrpeiVZklOwUsVhZtnTpBlUiIqOghi/ZZXDww0iA8Y8aIaV8vL850D+kXr9muYQ78ii6fBTfKuuLQ+blHqWYamFjFJedYCqbgvg5OTpvcJKQRQWSNsjGUtSuQ3SaBPK9ch/EpDX1JWl8dTseHLhZAgMBAAGjNjA0MCEGA1UdEgQaMBiCFk5PVF9GT1JfUFJ
 PRFVDVElPTl9VU0UwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQALwODmMIEEwUztngEOEHZoxRag4TQ+Mmz/39lLNVSWlC6Lf3hmPLSJ2rAQCIahs1WTpyBbc+iPyphwYfZkO1zKtpDcuq/aVnLzcJLrT29jl24aFzNWyusSbi9Z3jLj3N1iVHKLknT8uui0U2JsCvGzkeEH3gwReoD1+ENeWrohRzCCAhowggGDoAMCAQICBElUYAEwDQYJKoZIhvcNAQEFBQAwMzETMBEGA1UEChMKYXBhY2hlLm9yZzEMMAoGA1UECxMDZW5nMQ4wDAYDVQQDEwVjeGZjYTAeFw03MDAxMDEwMDAwMDBaFw0zODAxMTkwMzE0MDdaMDMxEzARBgNVBAoTCmFwYWNoZS5vcmcxDDAKBgNVBAsTA2VuZzEOMAwGA1UEAxMFYWxpY2UwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAL7u+O/1UoUPOX9egxknOCMYfT1aRoLshKqwrCvKvVxzmF/Zff4OcBAumXEdhcHzbKGh3CjT43ebEk81bQVpkI3wRHyKsE0e77ooTscjU8BM1cCCc76O6fP2mMZPlXQbUMauFMHiHH/4hZFGzNXGdaIl0UM3IkQYvgtQUAkBNKs7AgMBAAGjOzA5MCEGA1UdEgQaMBiCFk5PVF9GT1JfUFJPRFVDVElPTl9VU0UwFAYDVR0RBA0wC4IJbG9jYWxob3N0MA0GCSqGSIb3DQEBBQUAA4GBAIS8JJvvKbCreIJ24pBs1dE4KUlhnFsVigYvs/LSNp+oRQOb9Y1Rx2uBvYd7NJ8UNk3sM3kf5O4JoFdrCOPNzYK2B5k5iymgwVs2tqQLmbg4UB/BgBISWpBbSgT/vhAvazTaWZ6qh8cd6m9rVtuakbQcw5ivdtYIPTzKJjHO7qkU</wsse:BinarySecurityToken><ds:Signature
  Id="SIG-20518CC1C45561BA3A139904923417520" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><ds:SignedInfo><ds:CanonicalizationMethod
Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"><ec:InclusiveNamespaces PrefixList="doub
soap" xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"/></ds:CanonicalizationMethod><ds:SignatureMethod
Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><ds:Reference URI="#id-20518CC1C45561BA3A139904923417319"><ds:Transforms><ds:Transform
Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"><ec:InclusiveNamespaces PrefixList="doub"
xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"/></ds:Transform></ds:Transforms><ds:DigestMethod
Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><ds:DigestValue>zZ6sFJt4HHvAiKjqeksQcc0UzJM=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>Cp+ikniBCZSMkmSwIOTNenBx4vqYgsLGmVSVrKDGVy5k0ZUNacnj1nIZ1hqlimIXrws2268JMund
+q0bYL9kpL9+a/+/SHR4BGXhKVLqUUrYsbU9QqV9jgHDFRLgZKAfDYL7SjAIovCyubf0fCX6vh7yW
+4gGds/56Ls0PRPx306Y=</ds:SignatureValue><ds:KeyInfo Id="KI-20518CC1C45561BA3A139904923417217"><wsse:SecurityTokenReference
wsse11:TokenType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509PKIPathv1"
wsu:Id="STR-20518CC1C45561BA3A139904923417218" xmlns:wsse11="http://docs.oasis-open.org/wss/oasis-wss-wssecurity-secext-1.1.xsd"><wsse:Reference
URI="#X509-20518CC1C45561BA3A139904923417216" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509PKIPathv1"/></wsse:SecurityTokenReference></ds:KeyInfo></ds:Signature></wsse:Security></soap:Header>
+   <soap:Body wsu:Id="id-20518CC1C45561BA3A139904923417319" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
+      <doub:DoubleIt><!--This is a comment-->
+         <numberToDouble>25</numberToDouble>
+      <!--This is another comment--></doub:DoubleIt>
+   </soap:Body>
+</soap:Envelope>
\ No newline at end of file


Mime
View raw message