Package javax.xml.soap

Examples of javax.xml.soap.Name


            {
               // don't add an xmlns="..." attribute if the element has a prefix
               continue;
            }

            Name attrib_pqname =
               m_soap_factory.createName( attrib.getLocalName(  ),
                                          attrib.getPrefix(  ),
                                          attrib.getNamespaceURI(  ) );

            soap_elem.addAttribute( attrib_pqname,
View Full Code Here


      if ( Node.TEXT_NODE == child.getNodeType(  ) )
      {
         return null;
      }

      Name child_name = child.getElementName(  );

      if ( child_name == null )
      {
         return null;
      }

      String child_uri = child_name.getURI(  );

      if ( child_uri == null )
      {
         return null;
      }
View Full Code Here

      Iterator iter = soap_elem.getAllAttributes(  );

      while ( iter.hasNext(  ) )
      {
         Name attrib_pqname = (Name) iter.next(  );

         // skip all xmlns:foo attributes (e.g. xmlns:xs="urn:schema")
         if ( ( attrib_pqname.getPrefix(  ) != null )
              && attrib_pqname.getPrefix(  ).equals( XmlConstants.NSPREFIX_XMLNS ) )
         {
            continue;
         }

         // skip the xmlns attribute (e.g. xmlns="urn:default")
         if ( ( attrib_pqname.getLocalName(  ) != null )
              && attrib_pqname.getLocalName(  ).equals( XmlConstants.NSPREFIX_XMLNS ) )
         {
            continue;
         }

         appendAttribute( buf,
                          nameToString( attrib_pqname ),
                          soap_elem.getAttributeValue( attrib_pqname ),
                          depth );

         if ( ( ( attrib_pqname.getURI(  ) != null ) && !( "".equals( attrib_pqname.getURI(  ) ) ) )
              && ( ( attrib_pqname.getPrefix(  ) != null ) && !( "".equals( attrib_pqname.getPrefix(  ) ) ) )
              && ( soap_elem.getNamespaceURI( attrib_pqname.getPrefix(  ) ) == null ) )
         {
            appendNamespaceDeclarationAttribute( buf, attrib_pqname, depth );
         }
      }
   }
View Full Code Here

    */
   private void appendXmlnsAttributeIfNoPrefix( StringBuffer buf,
                                                SOAPElement  soap_elem,
                                                int          depth )
   {
      Name elem_pqname = soap_elem.getElementName(  );

      if ( ( elem_pqname.getPrefix(  ) == null ) && ( elem_pqname.getURI(  ) != null ) )
      {
         appendAttribute( buf,
                          XmlConstants.NSPREFIX_XMLNS,
                          elem_pqname.getURI(  ),
                          depth );
      }
   }
View Full Code Here

                                       int          depth )
   {
      Iterator prefixes             = soap_elem.getNamespacePrefixes(  );
      Set      encountered_prefixes = new HashSet(  );

      Name     name = soap_elem.getElementName(  );

      if ( hasNonEmptyValue( name.getPrefix(  ) ) && hasNonEmptyValue( name.getURI(  ) ) )
      {
         encountered_prefixes.add( name.getPrefix(  ) );
         appendNamespaceDeclarationAttribute( buf, name, depth );
      }

      while ( prefixes.hasNext(  ) )
      {
         String prefix = (String) prefixes.next(  );

         if ( encountered_prefixes.contains( prefix ) )
         {
            // duplicate prefix - skip it...
            continue;
         }

         encountered_prefixes.add( prefix );

         try
         {
            Name ns_pqname =
               SOAPFactory.newInstance(  ).createName( "",
                                                       prefix,
                                                       soap_elem.getNamespaceURI( prefix ) );

            appendNamespaceDeclarationAttribute( buf, ns_pqname, depth );
View Full Code Here

   throws SOAPException
   {
      if ( isElement( current_soap_node ) )
      {
         SOAPElement soap_elem   = (SOAPElement) current_soap_node;
         Name        elem_pqname = null;

         try
         {
            elem_pqname = soap_elem.getElementName(  );
         }
         catch ( RuntimeException re )
         {
            //LOG.error( ResourceKeys.MSG.getMsg( ResourceKeys.METHOD_FAILED, "SOAPElement.getElementName()" ) );
         }

         String elem_name = nameToString( elem_pqname );

         if ( ( elem_pqname.getPrefix(  ) == null ) || elem_pqname.getPrefix(  ).equals( "" ) )
         {
            String prefix = getPrefix( elem_pqname, (SOAPElement) root_soap_node );

            if ( prefix != null )
            {
View Full Code Here

    throws SAXException {
        try {
            HandlerStack stack = getStack();
            SOAPEnvelope env = (SOAPEnvelope) stack.getContextData ("envelope");
            String prefix = stack.getPrefixForURI(namespaceURI);
            Name name = env.createName (localName, prefix, namespaceURI);
            SOAPElement parent = (SOAPElement)elemStack.get(0);
            SOAPElement current = null;
            if (parent instanceof SOAPBody) {
                current = ((SOAPBody)parent).addBodyElement (name);
            } else if (parent instanceof SOAPHeader) {
View Full Code Here

        assertEquals(sender, Basic.getHeaderValue(response, "ReceiverKey"));
        assertEquals(factory, Basic.getHeaderValue(response, "SenderKey"));
        assertEquals(id, Basic.getHeaderValue(response, "RequestID"));
       
        SOAPBodyElement processlist = Basic.getFirstBodyElement(response);
        Name answerName = processlist.getElementName();
        assertEquals(Basic.ASAP_NS, answerName.getURI());
        assertEquals("CreateInstanceRs", answerName.getLocalName());
        Iterator processIterator = processlist.getChildElements();
        assertTrue(processIterator.hasNext());
        SOAPElement child = (SOAPElement) processIterator.next();
        Name childName = child.getElementName();
        assertEquals("as", childName.getPrefix());
        assertEquals("InstanceKey", childName.getLocalName());
       
        String instanceKey = XMLUtil.getFirstLevelTextContent(child);
        assertFalse(instanceKey.equals(""));
        assertFalse(processIterator.hasNext());
    }
View Full Code Here

        assertEquals(sender, Basic.getHeaderValue(response, "ReceiverKey"));
        assertEquals(factory, Basic.getHeaderValue(response, "SenderKey"));
        assertEquals(id, Basic.getHeaderValue(response, "RequestID"));
       
        SOAPBodyElement processlist = Basic.getFirstBodyElement(response);
        Name answerName = processlist.getElementName();
        assertEquals(Basic.ASAP_NS, answerName.getURI());
        assertEquals("CreateInstanceRs", answerName.getLocalName());
        Iterator processIterator = processlist.getChildElements();
        assertTrue(processIterator.hasNext());
        SOAPElement child = (SOAPElement) processIterator.next();
        Name childName = child.getElementName();
        assertEquals("as", childName.getPrefix());
        assertEquals("InstanceKey", childName.getLocalName());
       
        String instanceKey = XMLUtil.getFirstLevelTextContent(child);
        assertFalse(instanceKey.equals(""));
        assertFalse(processIterator.hasNext());
    }
View Full Code Here

        assertEquals(sender, Basic.getHeaderValue(response, "ReceiverKey"));
        assertEquals(factory, Basic.getHeaderValue(response, "SenderKey"));
        assertEquals(id, Basic.getHeaderValue(response, "RequestID"));
       
        SOAPBodyElement processlist = Basic.getFirstBodyElement(response);
        Name answerName = processlist.getElementName();
        assertEquals(Basic.WFXML_NS, answerName.getURI());
        assertEquals("GetDefinitionRs", answerName.getLocalName());
    }
View Full Code Here

TOP

Related Classes of javax.xml.soap.Name

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.