Package org.eclipse.wst.wsi.internal.core.analyzer

Examples of org.eclipse.wst.wsi.internal.core.analyzer.AssertionNotApplicableException


      }

      // If the binding does not contain wsdl:fault elements,
      // the assertion is not applicable
      if (!faultsFound)
        throw new AssertionNotApplicableException();
    }
    catch (AssertionNotApplicableException anae)
    {
      result = AssertionResult.RESULT_NOT_APPLICABLE;
    }
View Full Code Here


      }
      // If the binding contains no one mime:multipartRelated element,
      // the assertion is not applicable
      if (!multipartsFound)
        throw new AssertionNotApplicableException();
    }
    catch (AssertionNotApplicableException anae)
    {
      result = AssertionResult.RESULT_NOT_APPLICABLE;
    }
View Full Code Here

    {
      // If there is no the "namespace" attribute in the import,
      // the assertion is not applicable
      if (im.getNamespaceURI() == null)
      {
        throw new AssertionNotApplicableException();
      }

      // If a namespace URI is relative or invalid, the assertion failed
      URI uri = new URI(im.getNamespaceURI());
      if (!uri.isAbsolute())
View Full Code Here

        }
      }
      // If mime:content elements are not found,
      // the assertion is not applicable
      if (!mimeContentFound)
        throw new AssertionNotApplicableException();
    }
    catch (AssertionNotApplicableException anae)
    {
      result = AssertionResult.RESULT_NOT_APPLICABLE;
    }
View Full Code Here

  {
    try
    {
      // TODO need to handle soap with attachments
      if (entryContext.getMessageEntry().isMimeContent())
         throw new AssertionNotApplicableException();
        
      Binding[] bindings = validator.analyzerContext.getCandidateInfo().getBindings();

      // get soap message child name
      // Get the DOM contents of the message soap:body (if non-empty)
      Document messageDoc = null;

      QName messagePartElementQName = null;

      if (!entryContext.getMessageEntry().getMessage().equals(""))
      {
        messageDoc = entryContext.getMessageEntryDocument();
        //messageDoc = XMLUtils.parseXML(entryContext.getMessageEntry().getMessage(),
        //  WSIProperties.DEF_SOAP_SCHEMA);
        // get soap operation name from the soap:body

        // NOTE: getSoapBodyChild() may return null, if the soap:body did not contain any child elements
        Element soapMessageElement = validator.getSoapBodyChild(messageDoc);

        // for doc-lit... find the wsdl:part from one of the specified operations that has
        // the soap element used in the message.     
        // we are looking for a part with an element attrib val matching the soap message element
        if (soapMessageElement != null)
        {
          messagePartElementQName =
            new QName(
              soapMessageElement.getNamespaceURI(),
              soapMessageElement.getLocalName());
        }
      }

      if ((messageDoc == null) || this.validator.isFault(messageDoc))
      {
        // empty messages and fault messages do not qualify for this TA
        throw new AssertionNotApplicableException();
      }

      // look for match(s) in doc operations
      // if found, we're done, else
      // look for match(s) in rpc operations
View Full Code Here

  {
    try
    {
      if (!entryContext.getMessageEntry().isMimeContent())
      {
        throw new AssertionNotApplicableException();
      }

      // check for a fault element within the message
      if((entryContext.getMessageEntryDocument() == null) ||
          entryContext.getMessageEntryDocument().
          getElementsByTagNameNS(WSITag.ELEM_SOAP_FAULT.getNamespaceURI(),
              WSITag.ELEM_SOAP_FAULT.getLocalPart()).getLength() != 1)
        throw new AssertionNotApplicableException();
     
      BindingOperation bindingOperation = validator.getOperationMatch(
          EntryType.getEntryType(MessageValidator.TYPE_MESSAGE_REQUEST),
          entryContext.getRequestDocument());

      // If there is no matched operation, the assertion is not applicable
      if (bindingOperation == null)
        throw new AssertionNotApplicableException();
      // If the envelope in a response message contains a fault with attachments
      // and the corresponding wsdl:output element in the description is not
      // described using the WSDL MIME binding, the assertion is failed 
      if ((entryContext.getMessageEntry().getMimeParts().count() > 1) &&
          (getMultipartRelatedBindings(bindingOperation) == null))
View Full Code Here

    throws WSIException
  {
    try
    {
      if (validator.isOneWayResponse(entryContext))
        throw new AssertionNotApplicableException();

      // Getting a message document
      Document doc = entryContext.getMessageEntryDocument();

      Element soapOperation = null;
      // If there is a Fault entry or no body entries,
      // the assertion is not applicable
      if (validator.isFault(doc)
        || (soapOperation = validator.getSoapBodyChild(doc)) == null)
        throw new AssertionNotApplicableException();

      // Creating a qualified name of potential SOAP operation
      QName operationQName = new QName(
        soapOperation.getNamespaceURI(), soapOperation.getLocalName());

      // Retrieving all the RPC binding operations from wsdl:binding
      BindingOperation[] rpcBindingOperations =
        validator.getMatchingBindingOps(
          WSIConstants.ATTRVAL_SOAP_BIND_STYLE_RPC,
          validator.analyzerContext.getCandidateInfo().getBindings());

      // Retrieving binding operation by given operation name
      BindingOperation bindingOperation = validator.getOperationMatch(
        entryContext.getEntry().getEntryType(),
        operationQName,
        rpcBindingOperations);

      // If there is no matched operation, the assertion is not applicable
      if (bindingOperation == null)
        throw new AssertionNotApplicableException();

      // Finding operation message parts and extensibility elems
      // in the binding depending on message type
      List operationMessageParts = null;
      List extElems = null;
      if (entryContext.getMessageEntry().getType().equals(
        MessageEntry.TYPE_REQUEST))
      {
        operationMessageParts = bindingOperation.getOperation()
          .getInput().getMessage().getOrderedParts(null);
        if (bindingOperation.getBindingInput() != null)
          extElems =
            bindingOperation.getBindingInput().getExtensibilityElements();
      }
      else
      {
        operationMessageParts = bindingOperation.getOperation()
          .getOutput().getMessage().getOrderedParts(null);
        if (bindingOperation.getBindingOutput() != null)
          extElems =
            bindingOperation.getBindingOutput().getExtensibilityElements();
      }

      // If the message is not literal, the assertion is not applicable
      if (!validator.isLiteral(extElems))
        throw new AssertionNotApplicableException();


      /* Basic Profile Version 1.1 (http://www.ws-i.org/Profiles/Basic/2003-12/BasicProfile-1.1.htm)
       * says that the order of the elements in the soap:body of an ENVELOPE MUST be
       * the same as that of the wsdl:parts in the wsdl:message that describes it.
View Full Code Here

      Document doc = entryContext.getMessageEntryDocument();

      // If the message is empty or invalid, the assertion is not applicable
      if (doc == null)
      {
        throw new AssertionNotApplicableException();
      }

      // Getting header elements from envelope
      Element root = doc.getDocumentElement();
      NodeList headerList = root.getElementsByTagNameNS(
        WSIConstants.NS_URI_SOAP, XMLUtils.SOAP_ELEM_HEADER);

      // If there is no header, the assertion is not applicable
      if (headerList == null || headerList.getLength() == 0)
      {
        throw new AssertionNotApplicableException();
      }

      // Getting the header element
      Node header = headerList.item(0);

      // Getting the immediate child elements of the header
      NodeList elems = header.getChildNodes();

      // If there is no child elements of the header
      // the assertion is not applicable
      if (elems == null || elems.getLength() == 0)
      {
        throw new AssertionNotApplicableException();
      }

      // Walking through child elements
      for (int i = 0; i < elems.getLength(); i++)
      {
View Full Code Here

    try
    {
      // If there is a response message for one-way operation, the assertion is not applicable
      if (validator.isOneWayResponse(entryContext))
      {
        throw new AssertionNotApplicableException();
      }

      String httpHeader = entryContext.getMessageEntry().getHTTPHeaders();

      Map httpHeaderMap = HTTPUtils.getHttpHeaderTokens(httpHeader, ":");
View Full Code Here

      // Getting a message document
      Document doc = entryContext.getMessageEntryDocument();
      // If the message is empty or invalid, the assertion is not applicable
      if (doc == null)
      {
        throw new AssertionNotApplicableException();
      }

      // Getting the root element
      Element elem = doc.getDocumentElement();
      // If it is not the soap:Envelope, the assertion is not applicable
      if (!elem.getNamespaceURI().equals(WSIConstants.NS_URI_SOAP)
        || !elem.getLocalName().equals(XMLUtils.SOAP_ELEM_ENVELOPE))
      {
        throw new AssertionNotApplicableException();
      }

      // If the envelope contains the xmlns:xml namespace declaration,
      // the assertion failed
      String incorrectElementName = getIncorrectElementName(elem);
View Full Code Here

TOP

Related Classes of org.eclipse.wst.wsi.internal.core.analyzer.AssertionNotApplicableException

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.