Package org.apache.axis.message

Examples of org.apache.axis.message.MessageElement$NodeListImpl


            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


    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

                    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

                // 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

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

      return toAnyTypeElement( obj );
   }
View Full Code Here

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

    *
    * @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

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

                                    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

                                            boolean nillable )
   throws SerializationException
   {
      if ( obj instanceof MessageElement )
      {
         MessageElement element = (MessageElement) obj;
         if ( ( name == null ) || name.equals( element.getQName(  ) ) )
         {
            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 new MessageElement( (Element) obj );
         }
         else
         {
            throw new SerializationException( "notImplemented" );
         }
      }

      if ( name == null )
      {
         throw new IllegalArgumentException( "nullArgument:name" );
      }

      MessageElement messageElement = new MessageElement(  );
      messageElement.setQName( name );
      try
      {
         messageElement.setObjectValue( obj );
      }
      catch ( Exception e )
      {
         throw new SerializationException( "genericSerializationError", e );
      }

      if ( ( obj == null ) && nillable )
      {
         try
         {
            messageElement.addAttribute( Constants.NS_PREFIX_SCHEMA_XSI, Constants.URI_DEFAULT_SCHEMA_XSI, "nil",
                                         "true" );
         }
         catch ( Exception e )
         {
            throw new SerializationException( "genericSerializationError", e );
View Full Code Here

TOP

Related Classes of org.apache.axis.message.MessageElement$NodeListImpl

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.