Package org.apache.xml.security.utils.resolver

Examples of org.apache.xml.security.utils.resolver.ResourceResolverException


         // Element selectedElem = doc.getElementById(id);
         selectedElem = IdResolver.getElementById(doc, id);
         if (selectedElem==null) {
           Object exArgs[] = { id };
            throw new ResourceResolverException(
               "signature.Verification.MissingID", exArgs, uri, BaseURI);
         }
         if (log.isDebugEnabled())
           log.debug("Try to catch an Element with ID " + id + " and Element was " + selectedElem);
      }
View Full Code Here


            // log.debug("Use #xpointer(id('" + id + "')) on element " + selectedElem);

            if (resultNode == null) {
               Object exArgs[] = { id };

               throw new ResourceResolverException(
                  "signature.Verification.MissingID", exArgs, uri, BaseURI);
            }
            /*
            resultNodes =
               cXPathAPI
View Full Code Here

            // log.debug("Use #xpointer(id('" + id + "')) on element " + selectedElem);

            if (resultNode == null) {
               Object exArgs[] = { id };

               throw new ResourceResolverException(
                  "signature.Verification.MissingID", exArgs, uri, BaseURI);
            }
            /*
            resultNodes =
               cXPathAPI
View Full Code Here

/*    */
/* 76 */     if ((element == null) && (this.header != null)) {
/* 77 */       element = Util.findElementByWsuId(this.header, id);
/*    */     }
/* 79 */     if (element == null) {
/* 80 */       throw new ResourceResolverException(id, uri, BaseURI);
/*    */     }
/* 82 */     XMLSignatureInput input = new XMLSignatureInput(element);
/* 83 */     input.setMIMEType("text/xml");
/*    */
/* 85 */     input.setSourceURI(BaseURI + uri);
View Full Code Here

         */
        if (selectedElem == null) {
            SOAPConstants sc = WSSecurityUtil.getSOAPConstants(doc.getDocumentElement());
            selectedElem = WSSecurityUtil.findBodyElement(doc, sc);
            if (selectedElem == null) {
                throw new ResourceResolverException("generic.EmptyMessage",
                        new Object[]{"Body element not found"},
                        uri,
                        BaseURI);
            }
            String cId = selectedElem.getAttributeNS(WSConstants.WSU_NS, "Id");

            /*
             * If Body Id match fails, look for a generic Id (without a namespace)
             * that matches the URI. If that lookup fails, try to get a namespace
             * qualified Id that matches the URI.
             */
            if (!id.equals(cId)) {
                cId = null;
               
                if ((selectedElem = WSSecurityUtil.getElementByWsuId(doc, uriNodeValue)) != null) {
                    cId = selectedElem.getAttributeNS(WSConstants.WSU_NS, "Id");
                } else if ((selectedElem = WSSecurityUtil.getElementByGenId(doc, uriNodeValue)) != null) {
                    cId = selectedElem.getAttribute("Id");
                }
                if (cId == null) {
                    throw new ResourceResolverException("generic.EmptyMessage",
                            new Object[]{"Id not found"},
                            uri,
                            BaseURI);
                }
            }
View Full Code Here

                callbackLookup = new DOMCallbackLookup(uri.getOwnerDocument());
            }
            try {
                selectedElem = callbackLookup.getElement(id, null, true);
            } catch (WSSecurityException ex) {
                throw new ResourceResolverException(
                    ex.getMessage(), new Object[]{"Id: " + id + " not found"},
                    uri, BaseURI
                );
            }
            if (selectedElem == null) {
                throw new ResourceResolverException("generic.EmptyMessage",
                        new Object[]{"Id: " + id + " not found"},
                        uri,
                        BaseURI);
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.xml.security.utils.resolver.ResourceResolverException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.