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

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


          if (faultCodeNodes.item(j) instanceof Text)
          {
            Text faultCodeText = (Text) faultCodeNodes.item(j);
            if (faultCodeText.getData().indexOf('.') > 0)
            {
              throw new AssertionFailException();
              // dotted notation used.
            }
          }
        }
      }
View Full Code Here


      if (doc == null)
      {
        if (this.validator.isOneWayResponse(entryContext))
           throw new AssertionNotApplicableException();
        else 
             throw new AssertionFailException();
      }
      if (!doc.getDocumentElement().getLocalName().equals(XMLUtils.SOAP_ELEM_ENVELOPE))
        throw new AssertionFailException();
    }
    catch (AssertionFailException afe)
    {
      result = AssertionResult.RESULT_FAILED;
      failureDetail = validator.createFailureDetail(
View Full Code Here

          // Getting an inapplicable extensibility element of wsdl:input
          // If such element exists, the assertion failed
          inapplicableElement = getInapplicableElement(bindingInput.getExtensibilityElements());

          if (inapplicableElement != null)
            throw new AssertionFailException(inapplicableElement.toString());
        }
       
        // Getting an inapplicable extensibility element of wsdl:output
        // If such element exists, the assertion failed
        if (bindingOutput != null)
        {
          inapplicableElement =
            getInapplicableElement(bindingOutput.getExtensibilityElements());
          if (inapplicableElement != null)
            throw new AssertionFailException(inapplicableElement.toString());
        }
      }
    }
    catch (AssertionFailException afe)
    {
View Full Code Here

          WSIConstants.NS_URI_SOAP,
          XMLUtils.SOAP_ELEM_BODY);
      if (soapBodyList.getLength() == 0 || soapBodyList.getLength() > 1)
      {
        // There is not a body or more than one bodies in the envlope.
        throw new AssertionFailException();
      }
      Element soapBodyElem = (Element) soapBodyList.item(0);

      // Find wrapper element in the body
      Element wrapperElement = XMLUtils.getFirstChild(soapBodyElem);
      if (wrapperElement == null)
      {
        throw new AssertionFailException();
      }

      if (wrapperElement
        .getLocalName()
        .equals(bindingOperation.getName() + "Response"))
View Full Code Here

      while (child != null)
      {
        if (child.getAttributeNodeNS(
          ELEM_SOAP_BODY.getNamespaceURI(), "encodingStyle") != null)
        {
          throw new AssertionFailException("The child element name is \"" +
            child.getNodeName() + "\".");
        }
        // Getting the next soap:Body child element
        child = XMLUtils.getNextSibling(child);
      }
View Full Code Here

      // If the MIME binding is not used, but the message has
      // at least one non-root MIME part, the assertion failed
      if (!usesMimeBinding(extElems)
        && entryContext.getMessageEntry().getMimeParts().count() > 1)
      {
        throw new AssertionFailException("The wsdl:" + type + " of the \""
          + bindingOperation.getName() + "\" binding operation.");
      }
    }
    catch (AssertionNotApplicableException anae)
    {
View Full Code Here

          // Getting a value of this reference
          String ref = elem.getFirstChild() == null ? null
            : elem.getFirstChild().getNodeValue();
          // If the value is invalid, the assertion failed
          if (ref == null)
            throw new AssertionFailException("The element " + elem.getNodeName()
              + " of the ref:swaRef schema type is specified, but its vaule"
              + " is invalid.");
          // If the URI does not start with the "cid:" content-id prefix
          // The assertion failed
          if (!ref.startsWith("cid:"))
          {
            throw new AssertionFailException("The URI " + ref
              + " of the ref:swaRef schema type must use the cid: prefix.");
          }
          boolean refFound = false;
          Iterator iMimeParts = mimeParts.getParts().iterator();
          // Going through all the MIME parts of the SOAP message
          while (iMimeParts.hasNext())
          {
            MimePart mimePart = (MimePart)iMimeParts.next();
            // Getting part's Content-ID header
            String cid = MIMEUtils.getMimeHeaderAttribute(
                mimePart.getHeaders(), MIMEConstants.HEADER_CONTENT_ID);
            if (cid != null)
            {
              // If the header value equals the reference URI,
              // the corresponding MIME part is found
              if (cid.equals('<' + ref.substring(4) + '>'))
              {
                refFound = true;
                break;
              }
            }
          }
          // If the corresponding MIME part is not found
          // the assertion failed
          if (!refFound)
            throw new AssertionFailException("The SOAP message does not contain"
              + " a MIME part with the <" + ref.substring(4) + "> Content-ID.");
        }
      }
    }
    catch (AssertionNotApplicableException anae)
View Full Code Here

                && envChildElem.getLocalName().equals(XMLUtils.SOAP_ELEM_BODY))
              {
                // found a <soap:Body> so check its the last in the list of child elements of the Envelope
                if (envChildElem != envChildElemList.lastElement())
                {
                  throw new AssertionFailException(
                    entryContext.getMessageEntry().getMessage());
                }
              }
            }
          }
View Full Code Here

        }
        else
        {
          // HTTP version info expected but not found
          // (state the fact in the exception message?)
          throw new AssertionFailException(httpHeader);
        }

        // check that protocol version indicates HTTP/1.0 or HTTP/1.1
        if (!startLine.startsWith(MessageValidator.HTTP_VERSION_1_1)
          && !startLine.startsWith(MessageValidator.HTTP_VERSION_1_0))
        {
          throw new AssertionFailException(httpHeader);
        }
      }
      catch (AssertionFailException e)
      {
        result = AssertionResult.RESULT_FAILED;
View Full Code Here

      // if the parts attribute is an empty string and there is
      // at least one accessor, the assertion failed
      if (parts != null && parts.isEmpty()
        && !XMLUtils.getChildElements(soapOperation).isEmpty())
        throw new AssertionFailException("wsdl:operation name is "
          + bindingOperation.getName());

    }
    catch (AssertionNotApplicableException anae)
    {
View Full Code Here

TOP

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

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.