Package org.w3.x2000.x09.xmldsig

Examples of org.w3.x2000.x09.xmldsig.SignatureDocument


  public static Policy getPolicy( Element policy, String usedPolicyNamespace )
  {
    // policy = PolicyUtils.normalize(policy);

    Policy newPolicy = null;
    // check for ExactlyOne and All
    // TODO ExactlyOne and All are idempotent all empty ones should be skipped
    // and found the real ones
    Element exactlyOne = XmlUtils.getFirstChildElementNS( policy, usedPolicyNamespace, "ExactlyOne" );
    if( exactlyOne != null )
View Full Code Here


  {
    // check if found reference is addressing policy
    Element wsAddressing = XmlUtils.getFirstChildElementNS( wsamAddressingElm, WsaUtils.WS_A_NAMESPACE_200705,
        "Addressing" );
    Element addressingPolicy = null;
    Policy newPolicy = PolicyDocument.Factory.newInstance().addNewPolicy();
    Addressing newAddressing = null;
    if( wsAddressing != null )
    {
      newAddressing = newPolicy.addNewAddressing();
      String optional = wsAddressing.getAttributeNS( usedPolicyNamespace, "Optional" );
      if( !StringUtils.isNullOrEmpty( optional ) && optional.equals( OptionalType.TRUE.toString() ) )
      {
        newAddressing.setOptional( OptionalType.TRUE );
      }
      else
      {
        newAddressing.setOptional( OptionalType.FALSE );
      }
      addressingPolicy = XmlUtils.getFirstChildElementNS( wsAddressing, usedPolicyNamespace, "Policy" );
      if( addressingPolicy != null )
      {
        Element exactlyOne = XmlUtils.getFirstChildElementNS( addressingPolicy, usedPolicyNamespace, "ExactlyOne" );
        if( exactlyOne != null )
        {
          Element all = XmlUtils.getFirstChildElementNS( exactlyOne, usedPolicyNamespace, "All" );
          if( all != null )
          {
            getAddressingAnonymous( all, newAddressing );
          }
        }
        else
        {
          getAddressingAnonymous( addressingPolicy, newAddressing );
        }

      }
    }
    Element usingAddressing = XmlUtils.getFirstChildElementNS( wsamAddressingElm, WsaUtils.WS_A_NAMESPACE_200605,
        "UsingAddressing" );
    if( usingAddressing != null )
    {
      // add UsingAddressing to policy
      newPolicy.addNewUsingAddressing();
    }
    return newPolicy;
  }
View Full Code Here

    return newPolicy;
  }

  private static void getAddressingAnonymous( Element addressingPolicy, Addressing newAddressing )
  {
    Policy innerPolicy = newAddressing.addNewPolicy();
    // check if policy has Anonymous
    Element anonymousElm = XmlUtils.getFirstChildElementNS( addressingPolicy, new QName(
        WsaUtils.WS_A_NAMESPACE_200705, "AnonymousResponses" ) );
    if( anonymousElm != null )
    {
      innerPolicy.addNewAnonymousResponses();
    }
    else
    {
      Element nonAnonymousElement = XmlUtils.getFirstChildElementNS( addressingPolicy, new QName(
          WsaUtils.WS_A_NAMESPACE_200705, "NonAnonymousResponses" ) );
      if( nonAnonymousElement != null )
      {
        innerPolicy.addNewNonAnonymousResponses();
      }
    }
  }
View Full Code Here

                String optional = addressing.getOptional().toString();
                if (StringUtils.isNullOrEmpty(optional) || optional.equals("false")
                        || (optional.equals("true") && SoapUI.getSettings().getBoolean(WsaSettings.ENABLE_FOR_OPTIONAL))) {
                    interfaceWsaVersion = WsaVersionTypeConfig.X_200508.toString();
                }
                Policy innerPolicy = addressing.getPolicy();
                if (innerPolicy != null) {
                    List<AnonymousResponses> anonymousList = innerPolicy.getAnonymousResponsesList();
                    List<NonAnonymousResponses> nonAnonymousList = innerPolicy.getNonAnonymousResponsesList();
                    if (anonymousList.size() > 0 && nonAnonymousList.size() > 0) {
                        throw new Exception(
                                "Wrong addressing policy, anonymousResponses and nonAnonymousResponses can not be specified together");
                    }
                    if (anonymousList.size() > 0) {
View Full Code Here

    //
    // return policy;
    // }
    public static Policy getAttachedPolicy(ElementExtensible item, Definition def) {

        Policy rtnPolicy = null;
        String usedPolicyNamespace = PolicyUtils.WS_W3_POLICY_NAMESPACE;
        Element[] policyReferences = WsdlUtils.getExentsibilityElements(item, new QName(
                PolicyUtils.WS_W3_POLICY_NAMESPACE, "PolicyReference"));
        if (policyReferences.length <= 0) {
            policyReferences = WsdlUtils.getExentsibilityElements(item, new QName(
View Full Code Here

    }

    public static Policy getPolicy(Element policy, String usedPolicyNamespace) {
        // policy = PolicyUtils.normalize(policy);

        Policy newPolicy = null;
        // check for ExactlyOne and All
        // TODO ExactlyOne and All are idempotent all empty ones should be skipped
        // and found the real ones
        Element exactlyOne = XmlUtils.getFirstChildElementNS(policy, usedPolicyNamespace, "ExactlyOne");
        if (exactlyOne != null) {
View Full Code Here

    private static Policy getAddressingPolicy(Element wsamAddressingElm, String usedPolicyNamespace) {
        // check if found reference is addressing policy
        Element wsAddressing = XmlUtils.getFirstChildElementNS(wsamAddressingElm, WsaUtils.WS_A_NAMESPACE_200705,
                "Addressing");
        Element addressingPolicy = null;
        Policy newPolicy = PolicyDocument.Factory.newInstance().addNewPolicy();
        Addressing newAddressing = null;
        if (wsAddressing != null) {
            newAddressing = newPolicy.addNewAddressing();
            String optional = wsAddressing.getAttributeNS(usedPolicyNamespace, "Optional");
            if (!StringUtils.isNullOrEmpty(optional) && optional.equals(OptionalType.TRUE.toString())) {
                newAddressing.setOptional(OptionalType.TRUE);
            } else {
                newAddressing.setOptional(OptionalType.FALSE);
            }
            addressingPolicy = XmlUtils.getFirstChildElementNS(wsAddressing, usedPolicyNamespace, "Policy");
            if (addressingPolicy != null) {
                Element exactlyOne = XmlUtils.getFirstChildElementNS(addressingPolicy, usedPolicyNamespace, "ExactlyOne");
                if (exactlyOne != null) {
                    Element all = XmlUtils.getFirstChildElementNS(exactlyOne, usedPolicyNamespace, "All");
                    if (all != null) {
                        getAddressingAnonymous(all, newAddressing);
                    }
                } else {
                    getAddressingAnonymous(addressingPolicy, newAddressing);
                }

            }
        }
        Element usingAddressing = XmlUtils.getFirstChildElementNS(wsamAddressingElm, WsaUtils.WS_A_NAMESPACE_200605,
                "UsingAddressing");
        if (usingAddressing != null) {
            // add UsingAddressing to policy
            newPolicy.addNewUsingAddressing();
        }
        return newPolicy;
    }
View Full Code Here

        }
        return newPolicy;
    }

    private static void getAddressingAnonymous(Element addressingPolicy, Addressing newAddressing) {
        Policy innerPolicy = newAddressing.addNewPolicy();
        // check if policy has Anonymous
        Element anonymousElm = XmlUtils.getFirstChildElementNS(addressingPolicy, new QName(
                WsaUtils.WS_A_NAMESPACE_200705, "AnonymousResponses"));
        if (anonymousElm != null) {
            innerPolicy.addNewAnonymousResponses();
        } else {
            Element nonAnonymousElement = XmlUtils.getFirstChildElementNS(addressingPolicy, new QName(
                    WsaUtils.WS_A_NAMESPACE_200705, "NonAnonymousResponses"));
            if (nonAnonymousElement != null) {
                innerPolicy.addNewNonAnonymousResponses();
            }
        }
    }
View Full Code Here

        paths = ( XmlObject[] )listOfXmlObjcts.toArray();

        for( XmlObject obj : paths )
        {
          String xx = obj.xmlText( new XmlOptions().setSaveOuter() );
          PolicyDocument policyDocument = PolicyDocument.Factory.parse( xx );
          org.xmlsoap.schemas.ws.x2004.x09.policy.Policy polc = ( org.xmlsoap.schemas.ws.x2004.x09.policy.Policy )policyDocument
              .getPolicy();
          policies.add( polc );
          // List<Addressing> addressingList = polc.getAddressingList();
          // Addressing a = null;
          // if (addressingList.size() > 0 )
View Full Code Here

                listOfXmlObjcts.addAll(Arrays.asList(paths1));
                paths = (XmlObject[]) listOfXmlObjcts.toArray();

                for (XmlObject obj : paths) {
                    String xx = obj.xmlText(new XmlOptions().setSaveOuter());
                    PolicyDocument policyDocument = PolicyDocument.Factory.parse(xx);
                    org.xmlsoap.schemas.ws.x2004.x09.policy.Policy polc = (org.xmlsoap.schemas.ws.x2004.x09.policy.Policy) policyDocument
                            .getPolicy();
                    policies.add(polc);
                    // List<Addressing> addressingList = polc.getAddressingList();
                    // Addressing a = null;
                    // if (addressingList.size() > 0 )
View Full Code Here

TOP

Related Classes of org.w3.x2000.x09.xmldsig.SignatureDocument

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.