[WSS4J] wss4j/src/org/apache/ws/security/message EnvelopeIdResolver.java,1.8,1.9

[email protected] Wed, 07 Jan 2004 07:24:56 -0800
Newsgroups gmane.text.xml.wss4j
Message-ID <[email protected]>
Update of /cvsroot/wss4j/wss4j/src/org/apache/ws/security/message
In directory sc8-pr-cvs1:/tmp/cvs-serv625/src/org/apache/ws/security/message

Modified Files:
	EnvelopeIdResolver.java 
Log Message:
Fix bug with wsu:Id handling - TestScenario5 ok now

Index: EnvelopeIdResolver.java
===================================================================
RCS file: /cvsroot/wss4j/wss4j/src/org/apache/ws/security/message/EnvelopeIdResolver.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** EnvelopeIdResolver.java	2 Jan 2004 12:14:41 -0000	1.8
--- EnvelopeIdResolver.java	7 Jan 2004 15:24:54 -0000	1.9
***************
*** 71,75 ****
  import org.w3c.dom.NamedNodeMap;
  import org.w3c.dom.Node;
- import org.w3c.dom.traversal.NodeIterator;
  
  import java.util.HashSet;
--- 71,74 ----
***************
*** 175,203 ****
  			cId = null;
  			try {
! 				selectedElem =
  					(Element) XPathAPI.selectSingleNode(
  						doc,
! 						"//*[@Id='" + id + "']");
! 				if (selectedElem != null) {
  					cId = selectedElem.getAttribute("Id");
  				}
! 				else {
! 					NodeIterator iter =
! 						XPathAPI.selectNodeIterator(
  							doc,
! 							"//*[@*:Id='" + id + "']");
! 					for (selectedElem = (Element) iter.nextNode();
! 						selectedElem != null;
! 						selectedElem = (Element) iter.nextNode()) {
! 						if ((cId =
! 							selectedElem.getAttributeNS(
! 								WSConstants.WSU_NS,
! 								"Id"))
! 							!= null) {
! 							break;
! 						}
! 					}
  				}
! 			} catch (javax.xml.transform.TransformerException ex) {
  				throw new ResourceResolverException(
  					"generic.EmptyMessage",
--- 174,194 ----
  			cId = null;
  			try {
! 				if ((selectedElem =
  					(Element) XPathAPI.selectSingleNode(
  						doc,
! 						"//*[@Id='" + id + "']"))
! 					!= null) {
  					cId = selectedElem.getAttribute("Id");
  				}
! 				else if ((selectedElem =
! 						(Element) XPathAPI.selectSingleNode(
  							doc,
! 							"//*[@wsu:Id='" + id + "']",
! 							WSSecurityUtil.createNamespaceContext(doc)))
! 						!= null) {
! 					cId = selectedElem.getAttribute("Id");
  				}
! 			}
! 			catch (javax.xml.transform.TransformerException ex) {
  				throw new ResourceResolverException(
  					"generic.EmptyMessage",




-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click