cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r917855 - /cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java
Date Tue, 02 Mar 2010 03:28:22 GMT
Author: dkulp
Date: Tue Mar  2 03:28:21 2010
New Revision: 917855

URL: http://svn.apache.org/viewvc?rev=917855&view=rev
Log:
Make sure the namespace prefixes are defined in the sts messages.

Modified:
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java?rev=917855&r1=917854&r2=917855&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java
Tue Mar  2 03:28:21 2010
@@ -365,6 +365,7 @@
 
         W3CDOMStreamWriter writer = new W3CDOMStreamWriter();
         writer.writeStartElement("wst", "RequestSecurityToken", namespace);
+        writer.writeNamespace("wst", namespace);
         boolean wroteKeySize = false;
         String keyType = null;
         if (template != null) {
@@ -418,8 +419,9 @@
             }
         } else if (keyType.endsWith("PublicKey")) {
             writer.writeStartElement("wst", "UseKey", namespace);
-            writer.writeStartElement("http://www.w3.org/2000/09/xmldsig#", "KeyInfo");
-            writer.writeStartElement("http://www.w3.org/2000/09/xmldsig#", "KeyValue");
+            writer.writeStartElement("dsig", "KeyInfo", "http://www.w3.org/2000/09/xmldsig#");
+            writer.writeNamespace("dsig", "http://www.w3.org/2000/09/xmldsig#");
+            writer.writeStartElement("dsig", "KeyValue", "http://www.w3.org/2000/09/xmldsig#");
             crypto = createCrypto(false);
             cert = getCert(crypto);
             PublicKey key = cert.getPublicKey();
@@ -529,6 +531,7 @@
         
         W3CDOMStreamWriter writer = new W3CDOMStreamWriter();
         writer.writeStartElement("wst", "RequestSecurityToken", namespace);
+        writer.writeNamespace("wst", namespace);
         writer.writeStartElement("wst", "RequestType", namespace);
         writer.writeCharacters(namespace + "/Validate");
         writer.writeEndElement();
@@ -602,6 +605,7 @@
 
         W3CDOMStreamWriter writer = new W3CDOMStreamWriter();
         writer.writeStartElement("wst", "RequestSecurityToken", namespace);
+        writer.writeNamespace("wst", namespace);
         writer.writeStartElement("wst", "RequestType", namespace);
         writer.writeCharacters(namespace + "/Cancel");
         writer.writeEndElement();
@@ -666,6 +670,7 @@
 
         XmlSchemaDateFormat fmt = new XmlSchemaDateFormat();
         writer.writeStartElement("wst", "Lifetime", namespace);
+        writer.writeNamespace("wsu", WSConstants.WSU_NS);
         writer.writeStartElement("wsu", "Created", WSConstants.WSU_NS);
         writer.writeCharacters(fmt.format(creationTime));
         writer.writeEndElement();
@@ -679,7 +684,9 @@
     private void addAppliesTo(XMLStreamWriter writer, String appliesTo) throws XMLStreamException
{
         if (appliesTo != null && addressingNamespace != null) {
             writer.writeStartElement("wsp", "AppliesTo", "http://schemas.xmlsoap.org/ws/2004/09/policy");
+            writer.writeNamespace("wsp", "http://schemas.xmlsoap.org/ws/2004/09/policy");
             writer.writeStartElement("wsa", "EndpointReference", addressingNamespace);
+            writer.writeNamespace("wsa", addressingNamespace);
             writer.writeStartElement("wsa", "Address", addressingNamespace);
             writer.writeCharacters(appliesTo);
             writer.writeEndElement();



Mime
View raw message