Examples of BindingMessageReferenceElement


Examples of org.apache.woden.wsdl20.xml.BindingMessageReferenceElement

            XMLElement msgRefEl,
            DescriptionElement desc,
            BindingOperationElement parent)
            throws WSDLException {

        BindingMessageReferenceElement message = parent.addBindingMessageReferenceElement();

        if(Constants.ELEM_INPUT.equals(msgRefEl.getLocalName())) {
            message.setDirection(Direction.IN);
        }
        else if(Constants.ELEM_OUTPUT.equals(msgRefEl.getLocalName())) {
            message.setDirection(Direction.OUT);
        }

        String msgLabel = msgRefEl.getAttributeValue(Constants.ATTR_MESSAGE_LABEL);
        if(msgLabel != null)
        {
            message.setMessageLabel(new NCName(msgLabel));
        }
        else
        {
            //This is a limited solution supporting the 3 MEPs in the Part 2 spec.
            //TODO generic support for user-defined, extensible MEPs.
            if(message.getDirection().equals(Direction.IN))
            {
                message.setMessageLabel(MessageLabel.IN);
            }
            else
            {
                message.setMessageLabel(MessageLabel.OUT);
            }
        }

        parseExtensionAttributes(msgRefEl, BindingMessageReferenceElement.class, message, desc);

        /* Parse the child elements of binding operation <input> or <output>.
         * As per WSDL 2.0 spec, they must be in the following order if present:
         * <documentation>
         * extension elements in any order
         * TODO validate that the elements are in correct order
         */

        XMLElement[] children = msgRefEl.getChildElements();
        XMLElement tempEl = null;
        QName tempElQN = null;

        for(int i=0; i<children.length; i++)
        {
            tempEl = children[i];
            tempElQN = tempEl.getQName();

            if (Constants.Q_ELEM_DOCUMENTATION.equals(tempElQN))
            {
                parseDocumentation(tempEl, desc, message);
            }
            else
            {
                message.addExtensionElement(
                        parseExtensionElement(BindingMessageReferenceElement.class, message, tempEl, desc) );
            }
        }

        return message;
View Full Code Here

Examples of org.apache.woden.wsdl20.xml.BindingMessageReferenceElement

    public void testGetSoapModules_input()
    {
        BindingMessageReference bindMsgRef = fBindOper.getBindingMessageReferences()[0];
        assertNotNull("The BindingOperation does not contain a BindingMessageReference.", bindMsgRef);

        BindingMessageReferenceElement bindMsgRefEl = bindMsgRef.toElement();
        Direction direction = bindMsgRefEl.getDirection();
        assertTrue("The BindingMessageReference does not represent an <input> element.", Direction.IN.equals(direction));

        SOAPBindingMessageReferenceExtensions soapBindMsgRefExts =
            (SOAPBindingMessageReferenceExtensions) bindMsgRef.getComponentExtensionContext(SOAPConstants.NS_URI_SOAP);
        SOAPModule[] actual = soapBindMsgRefExts.getSoapModules();
View Full Code Here

Examples of org.apache.woden.wsdl20.xml.BindingMessageReferenceElement

    public void testGetSoapModules_output()
    {
        BindingMessageReference bindMsgRef = fBindOper.getBindingMessageReferences()[1];
        assertNotNull("The BindingOperation does not contain a second BindingMessageReference.", bindMsgRef);

        BindingMessageReferenceElement bindMsgRefEl = bindMsgRef.toElement();
        Direction direction = bindMsgRefEl.getDirection();
        assertTrue("The BindingMessageReference does not represent an <output> element.", Direction.OUT.equals(direction));

        SOAPBindingMessageReferenceExtensions soapBindMsgRefExts =
            (SOAPBindingMessageReferenceExtensions) bindMsgRef.getComponentExtensionContext(SOAPConstants.NS_URI_SOAP);
        SOAPModule[] actual = soapBindMsgRefExts.getSoapModules();
View Full Code Here

Examples of org.apache.woden.wsdl20.xml.BindingMessageReferenceElement

      binding.setName(name2);
      binding.setInterfaceName(name1QN);
      BindingOperationElement bindingOperation = binding.addBindingOperationElement();
      bindingOperation.setRef(name3QN);

      BindingMessageReferenceElement bindingMessageReference = bindingOperation.addBindingMessageReferenceElement();
      bindingMessageReference.setMessageLabel(MessageLabel.IN);
         
    if(!val.testAssertionBindingMessageReference1052(descEl.toComponent().getBindings()[0].getBindingOperations()[0].getBindingMessageReferences(), reporter))
    {
      fail("The testAssertionBindingMessageReference1052 method returned false with one valid binding message reference defined.");
    }
  }
  catch(WSDLException e)
  {
    fail("There was a problem running the test assertion method " + e);
  }
 
  // Test that the assertion returns true when there are two binding message references defined with
  // unique interface message references.
  try
  {
      DescriptionElement descEl = factory.newDescription();
      descEl.setTargetNamespace(namespace1);
      InterfaceElement interfac = descEl.addInterfaceElement();
      interfac.setName(name1);
      InterfaceOperationElement interfaceOperation = interfac.addInterfaceOperationElement();
      interfaceOperation.setName(name3);
      InterfaceMessageReferenceElement interfaceMessageReference = interfaceOperation.addInterfaceMessageReferenceElement();
      interfaceMessageReference.setMessageLabel(MessageLabel.IN);
      InterfaceMessageReferenceElement interfaceMessageReference2 = interfaceOperation.addInterfaceMessageReferenceElement();
      interfaceMessageReference2.setMessageLabel(MessageLabel.OUT);
      BindingElement binding = descEl.addBindingElement();
      binding.setName(name2);
      binding.setInterfaceName(name1QN);
      BindingOperationElement bindingOperation = binding.addBindingOperationElement();
      bindingOperation.setRef(name3QN);
      BindingMessageReferenceElement bindingMessageReference = bindingOperation.addBindingMessageReferenceElement();
      bindingMessageReference.setMessageLabel(MessageLabel.IN);
      BindingMessageReferenceElement bindingMessageReference2 = bindingOperation.addBindingMessageReferenceElement();
      bindingMessageReference2.setMessageLabel(MessageLabel.OUT);
         
    if(!val.testAssertionBindingMessageReference1052(descEl.toComponent().getBindings()[0].getBindingOperations()[0].getBindingMessageReferences(), reporter))
    {
      fail("The testAssertionBindingMessageReference1052 method returned false with two valid binding message references defined.");
    }
  }
  catch(WSDLException e)
  {
    fail("There was a problem running the test assertion method " + e);
  }
 
 
  // Test that the assertion returns false when there are two binding message references define with
  // the same interface message reference.
  try
  {
      DescriptionElement descEl = factory.newDescription();
      descEl.setTargetNamespace(namespace1);
      InterfaceElement interfac = descEl.addInterfaceElement();
      interfac.setName(name1);
      InterfaceOperationElement interfaceOperation = interfac.addInterfaceOperationElement();
      interfaceOperation.setName(name3);
      InterfaceMessageReferenceElement interfaceMessageReference = interfaceOperation.addInterfaceMessageReferenceElement();
      interfaceMessageReference.setMessageLabel(MessageLabel.IN);
      BindingElement binding = descEl.addBindingElement();
      binding.setName(name2);
      binding.setInterfaceName(name1QN);
      BindingOperationElement bindingOperation = binding.addBindingOperationElement();
      bindingOperation.setRef(name3QN);
      BindingMessageReferenceElement bindingMessageReference = bindingOperation.addBindingMessageReferenceElement();
      bindingMessageReference.setMessageLabel(MessageLabel.IN);
      BindingMessageReferenceElement bindingMessageReference2 = bindingOperation.addBindingMessageReferenceElement();
      bindingMessageReference2.setMessageLabel(MessageLabel.IN);
         
    if(val.testAssertionBindingMessageReference1052(descEl.toComponent().getBindings()[0].getBindingOperations()[0].getBindingMessageReferences(), reporter))
    {
      fail("The testAssertionBindingMessageReference1052 method returned true with two binding message references defined with the same interface message reference.");
    }
View Full Code Here

Examples of org.apache.woden.wsdl20.xml.BindingMessageReferenceElement

     * - getBindingMessageReferences()
     */
  public void testGetBindingMessageReferences()
  {
    // create some BindingMessageReferenceElements
    BindingMessageReferenceElement bmre1 = fBindingOperationElement.addBindingMessageReferenceElement();
    BindingMessageReferenceElement bmre2 = fBindingOperationElement.addBindingMessageReferenceElement();
   
    fDescriptionElement.toComponent();
   
    // getBindingMessageReferences()
    BindingMessageReference[] bmrArray = fBindingOperation.getBindingMessageReferences();
View Full Code Here

Examples of org.apache.woden.wsdl20.xml.BindingMessageReferenceElement

            XMLElement msgRefEl,
            DescriptionElement desc,
            BindingOperationElement parent)
            throws WSDLException {

        BindingMessageReferenceElement message = parent.addBindingMessageReferenceElement();

        if(Constants.ELEM_INPUT.equals(msgRefEl.getLocalName())) {
            message.setDirection(Direction.IN);
        }
        else if(Constants.ELEM_OUTPUT.equals(msgRefEl.getLocalName())) {
            message.setDirection(Direction.OUT);
        }

        String msgLabel = msgRefEl.getAttributeValue(Constants.ATTR_MESSAGE_LABEL);
        if(msgLabel != null)
        {
            message.setMessageLabel(new NCName(msgLabel));
        }
        else
        {
            //This is a limited solution supporting the 3 MEPs in the Part 2 spec.
            //TODO generic support for user-defined, extensible MEPs.
            if(message.getDirection().equals(Direction.IN))
            {
                message.setMessageLabel(MessageLabel.IN);
            }
            else
            {
                message.setMessageLabel(MessageLabel.OUT);
            }
        }

        parseExtensionAttributes(msgRefEl, BindingMessageReferenceElement.class, message, desc);

        /* Parse the child elements of binding operation <input> or <output>.
         * As per WSDL 2.0 spec, they must be in the following order if present:
         * <documentation>
         * extension elements in any order
         * TODO validate that the elements are in correct order
         */

        XMLElement[] children = msgRefEl.getChildElements();
        XMLElement tempEl = null;
        QName tempElQN = null;

        for(int i=0; i<children.length; i++)
        {
            tempEl = children[i];
            tempElQN = tempEl.getQName();

            if (Constants.Q_ELEM_DOCUMENTATION.equals(tempElQN))
            {
                parseDocumentation(tempEl, desc, message);
            }
            else
            {
                message.addExtensionElement(
                        parseExtensionElement(BindingMessageReferenceElement.class, message, tempEl, desc) );
            }
        }

        return message;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.