Author: alessio.soldano(a)jboss.com
Date: 2011-01-27 05:36:59 -0500 (Thu, 27 Jan 2011)
New Revision: 13621
Modified:
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/extensions/security/element/UsernameToken.java
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1988/MessageTestCase.java
Log:
[JBPAPP-4525] Created element within UsernameToken uses wsse namespace instead of wsu
namespace
Modified:
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/extensions/security/element/UsernameToken.java
===================================================================
---
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/extensions/security/element/UsernameToken.java 2011-01-27
10:23:33 UTC (rev 13620)
+++
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/extensions/security/element/UsernameToken.java 2011-01-27
10:36:59 UTC (rev 13621)
@@ -96,7 +96,7 @@
this.nonce = XMLUtils.getFullTextChildrenFromElement(elem);
}
- Iterator<Element> itCreated = DOMUtils.getChildElements(element, new
QName(Constants.WSSE_NS, "Created"));
+ Iterator<Element> itCreated = DOMUtils.getChildElements(element, new
QName(Constants.WSU_NS, "Created"));
if (itCreated != null && itCreated.hasNext())
{
this.created = XMLUtils.getFullTextChildrenFromElement(itCreated.next());
@@ -163,7 +163,7 @@
}
if (created != null)
{
- child = doc.createElementNS(Constants.WSSE_NS, Constants.WSSE_PREFIX +
":" + "Created");
+ child = doc.createElementNS(Constants.WSU_NS, Constants.WSU_PREFIX +
":" + "Created");
child.appendChild(doc.createTextNode(created));
element.appendChild(child);
}
Modified:
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1988/MessageTestCase.java
===================================================================
---
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1988/MessageTestCase.java 2011-01-27
10:23:33 UTC (rev 13620)
+++
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1988/MessageTestCase.java 2011-01-27
10:36:59 UTC (rev 13621)
@@ -112,7 +112,7 @@
"<wsse:Username>kermit</wsse:Username>" +
"<wsse:Password
Type='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-usernam...
+
"<wsse:Nonce
EncodingType='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss...
+
- "<wsse:Created>CREATED</wsse:Created>" +
+ "<wsu:Created>CREATED</wsu:Created>" +
"</wsse:UsernameToken>" +
"</wsse:Security>" +
"</env:Header>" +
@@ -148,7 +148,7 @@
"<wsse:Username>kermit</wsse:Username>" +
"<wsse:Password
Type='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-usernam...
+
"<wsse:Nonce>gHGIdDEWjX1Ay/LiVd3qJ1ua8VbjXis8CJwNDQh1ySA=</wsse:Nonce>"
+
- "<wsse:Created>CREATED</wsse:Created>" +
+ "<wsu:Created>CREATED</wsu:Created>" +
"</wsse:UsernameToken>" +
"</wsse:Security>" +
"</env:Header>" +
@@ -196,7 +196,7 @@
assertNotNull(nonceEl);
assertNotNull(DOMUtils.getTextContent(nonceEl));
assertEquals(nonceEl.getAttribute("EncodingType"),
Constants.WSS_SOAP_NS+"#Base64Binary");
- Element createdEl = (Element)DOMUtils.getChildElements(usernameTokenEl, new
QName(Constants.WSSE_NS, "Created")).next();
+ Element createdEl = (Element)DOMUtils.getChildElements(usernameTokenEl, new
QName(Constants.WSU_NS, "Created")).next();
assertNotNull(createdEl);
assertNotNull(DOMUtils.getTextContent(createdEl));
}
@@ -218,7 +218,7 @@
assertNotNull(nonceEl);
assertNotNull(DOMUtils.getTextContent(nonceEl));
assertEquals(nonceEl.getAttribute("EncodingType"),
Constants.WSS_SOAP_NS+"#Base64Binary");
- assertFalse(DOMUtils.getChildElements(usernameTokenEl, new QName(Constants.WSSE_NS,
"Created")).hasNext());
+ assertFalse(DOMUtils.getChildElements(usernameTokenEl, new QName(Constants.WSU_NS,
"Created")).hasNext());
}
public void testEncodeMessageWithCreated() throws Exception
@@ -235,7 +235,7 @@
Element usernameTokenEl = (Element)DOMUtils.getChildElements(securityEl, new
QName(Constants.WSSE_NS, "UsernameToken")).next();
assertPassword(usernameTokenEl);
assertFalse(DOMUtils.getChildElements(usernameTokenEl, new QName(Constants.WSSE_NS,
"Nonce")).hasNext());
- Element createdEl = (Element)DOMUtils.getChildElements(usernameTokenEl, new
QName(Constants.WSSE_NS, "Created")).next();
+ Element createdEl = (Element)DOMUtils.getChildElements(usernameTokenEl, new
QName(Constants.WSU_NS, "Created")).next();
assertNotNull(createdEl);
assertNotNull(DOMUtils.getTextContent(createdEl));
}