Examples of MessageElement


Examples of org.apache.axis.message.MessageElement

    public void testDetachNode() throws Exception {
        SOAPConstants sc = SOAPConstants.SOAP11_CONSTANTS;
        EnvelopeBuilder eb = new EnvelopeBuilder(Message.REQUEST, sc);
        DeserializationContext dc = new DeserializationContextImpl(null,
                                                                   eb);
        SOAPElement parent = new MessageElement("parent.names",
                                                "parent",
                                                "parns",
                                                null,
                                                dc);
        SOAPElement child1 = parent.addChildElement("child1");
        SOAPElement child2 = parent.addChildElement("child2");
        SOAPElement child3 = parent.addChildElement("child3");

        child2.detachNode();
        SOAPElement c[] = {child1, child3};
       
        Iterator children = parent.getChildElements();
        for (int i = 0; i < 2; i++) {
            assertEquals("Child not found",
                         c[i],
                         children.next());
        }
View Full Code Here

Examples of org.apache.axis.message.MessageElement

            ExtensibilityType expression = new ExtensibilityType();
            FindBooksQueryExpressionElement bookQuery = new FindBooksQueryExpressionElement();
            BookType book = new BookType();
            book.setSubject("all");
            bookQuery.setBookQuery(book);
            MessageElement el = new MessageElement("foo", "Bar", bookQuery);
            expression.set_any(new MessageElement [] { el });
            ExtensibilityType any = binding.query(expression);
            MessageElement [] anyContent = any.get_any();
            assertEquals(1, anyContent.length);
            QueryResultElement resEl = (QueryResultElement )anyContent[0].getObjectValue();
View Full Code Here

Examples of org.apache.axis.message.MessageElement

    public final void onEndElement(String namespace, String localName,
                                   DeserializationContext context)
        throws SAXException
    {
        try {
            MessageElement msgElem = context.getCurElement();
            if ( msgElem != null ) {
                MessageContext messageContext = context.getMessageContext();
                Boolean currentElement = (Boolean) messageContext.getProperty(DESERIALIZE_CURRENT_ELEMENT);
                if (currentElement != null && currentElement.booleanValue()) {
                    value = msgElem.getAsDOM();
                    messageContext.setProperty(DESERIALIZE_CURRENT_ELEMENT, Boolean.FALSE);
                    return;
                }
                ArrayList children = msgElem.getChildren();
                if ( children != null ) {
                    msgElem = (MessageElement) children.get(0);
                    if ( msgElem != null )
                        value = msgElem.getAsDOM();
                }
            }
        }
        catch( Exception exp ) {
            log.error(JavaUtils.getMessage("exception00"), exp);
View Full Code Here

Examples of org.apache.axis.message.MessageElement

                    MessageElement [] newElements = new MessageElement[length + 1];
                    if (curElements != null) {
                        System.arraycopy(curElements, 0,
                                         newElements, 0, length);
                    }
                    MessageElement thisEl = context.getCurElement();

                    newElements[length] = thisEl;
                    propDesc.set(value, newElements);

                    return new SOAPHandler();
View Full Code Here

Examples of org.apache.axis.message.MessageElement

                // of MessageElements.  Serialize each one.
                Object anyVal = anyDesc.get(value);
                if (anyVal != null && anyVal instanceof MessageElement[]) {
                    MessageElement [] anyContent = (MessageElement[])anyVal;
                    for (int i = 0; i < anyContent.length; i++) {
                        MessageElement element = anyContent[i];
                        element.output(context);
                    }
                }
            }
        } catch (InvocationTargetException ite) {
            Throwable target = ite.getTargetException();
View Full Code Here

Examples of org.apache.axis.message.MessageElement

      {
         return (MessageElement) obj;
      }
      else if ( obj instanceof Element )
      {
         return new MessageElement( (Element) obj );
      }

      return toAnyTypeElement( obj );
   }
View Full Code Here

Examples of org.apache.axis.message.MessageElement

    */
   public static MessageElement[] toAnyArray( Element element )
   {
      return new MessageElement[]
             {
                new MessageElement( element )
             };
   }
View Full Code Here

Examples of org.apache.axis.message.MessageElement

    *
    * @return content of any element as a SOAP MessageElement
    */
   public static MessageElement toAnyTypeElement( Object obj )
   {
      MessageElement messageElement = new MessageElement( NamespaceConstants.NSURI_GLOBUS_CORE, "value", obj );
      messageElement.setType( org.apache.axis.Constants.XSD_ANYTYPE );
      return messageElement;
   }
View Full Code Here

Examples of org.apache.axis.message.MessageElement

    */
   public static MessageElement[] toText( Object obj )
   {
      return new MessageElement[]
             {
                new MessageElement( new Text( obj.toString(  ) ) )
             };
   }
View Full Code Here

Examples of org.apache.axis.message.MessageElement

                                    boolean nillable )
   throws SerializationException
   {
      if ( obj instanceof MessageElement )
      {
         MessageElement messageElement = (MessageElement) obj;
         if ( ( name == null ) || name.equals( messageElement.getQName(  ) ) )
         {
            Element element = null;
            try
            {
               element = AnyHelper.toElement( messageElement );
            }
            catch ( Exception e )
            {
               throw new SerializationException( "genericSerializationError", e );
            }

            return element;
         }
         else
         {
            throw new SerializationException( "notImplemented" );
         }
      }
      else if ( obj instanceof Element )
      {
         Element element = (Element) obj;
         if ( ( name == null )
              || ( name.getLocalPart(  ).equals( element.getLocalName(  ) )
              && name.getNamespaceURI(  ).equals( element.getNamespaceURI(  ) ) ) )
         {
            return element;
         }
         else
         {
            throw new SerializationException( "notImplemented" );
         }
      }

      MessageElement messageElement = (MessageElement) toSOAPElement( obj, name, nillable );
      try
      {
         return AnyHelper.toElement( messageElement );
      }
      catch ( Exception e )
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.