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

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


                return result;
            } else {
                Object exArgs[] = {"The URI " + URI + " is not configured for offline work" };

                throw new ResourceResolverException(
                    "generic.EmptyMessage", exArgs, uri, BaseURI
                );
            }
        } catch (IOException ex) {
            throw new ResourceResolverException("generic.EmptyMessage", ex, uri, BaseURI);
        }
    }
View Full Code Here


           
            if (secureValidation) {
                Element start = uri.getOwnerDocument().getDocumentElement();
                if (!XMLUtils.protectAgainstWrappingAttack(start, id)) {
                    Object exArgs[] = { id };
                    throw new ResourceResolverException(
                        "signature.Verification.MultipleIDs", exArgs, uri, baseURI
                    );
                }
            }

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

                throw new ResourceResolverException(
                    "signature.Verification.MissingID", exArgs, uri, baseURI
                );
            }
        }
View Full Code Here

                return result;
            } else {
                Object exArgs[] = {"The URI " + URI + " is not configured for offline work"};

                throw new ResourceResolverException("generic.EmptyMessage", exArgs, uri, BaseURI);
            }
        } catch (IOException ex) {
            throw new ResourceResolverException("generic.EmptyMessage", ex, uri, BaseURI);
        }
    }
View Full Code Here

         */
        String id = uriNodeValue.substring(1);
        SOAPConstants sc = WSSecurityUtil.getSOAPConstants(doc.getDocumentElement());
        Element 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

      // If its not in the document, try the header
      if (element == null && header != null)
         element = Util.findElementByWsuId(header, id);

      if (element == null)
         throw new ResourceResolverException(id, uri, BaseURI);

      XMLSignatureInput input = new XMLSignatureInput(element);
      input.setMIMEType("text/xml");

      input.setSourceURI(BaseURI + uri);
View Full Code Here

            return result;
         } else {
            Object exArgs[] = {
               "The URI " + URI + " is not configured for offline work" };

            throw new ResourceResolverException("generic.EmptyMessage", exArgs,
                                                uri, BaseURI);
         }
      } catch (IOException ex) {
         throw new ResourceResolverException("generic.EmptyMessage", ex, uri,
                                             BaseURI);
      }
   }
View Full Code Here

            result.setSourceURI(uriNew.toString());

            return result;
        } catch (Exception e) {
            throw new ResourceResolverException("generic.EmptyMessage", e, uri,
                                            BaseURI);
        }
    }
View Full Code Here

         // 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

         result.setSourceURI(uriNew.toString());
         result.setMIMEType(mimeType);

         return result;
      } catch (MalformedURLException ex) {
         throw new ResourceResolverException("generic.EmptyMessage", ex, uri,
                                             BaseURI);
      } catch (IOException ex) {
         throw new ResourceResolverException("generic.EmptyMessage", ex, uri,
                                             BaseURI);
      } finally {
           // switch off proxy usage
           if (useProxy && switchBackProxy) {
               System.setProperty("http.proxySet", oldProxySet);
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.