Package org.jboss.ws.core.soap

Examples of org.jboss.ws.core.soap.NameImpl


      assertFalse(soapHeader.getChildElements().hasNext());

      try
      {
         Name name = new NameImpl("Foo");
         soapHeader.addHeaderElement(name);
         fail("Invalid name: " + name);
      }
      catch (SOAPException e)
      {
         // ignore
      }

      Name name = new NameImpl("Foo", "ns1", "http://org.jboss.ws/header");
      soapHeader.addHeaderElement(name);
      SOAPHeaderElement shElement = (SOAPHeaderElement)soapHeader.getChildElements(name).next();
      shElement.setValue("SomeHeaderValue");
      assertEquals(name, shElement.getElementName());
View Full Code Here


      Iterator it = soapHeader.examineAllHeaderElements();
      SOAPHeaderElement foo = (SOAPHeaderElement)it.next();
      SOAPHeaderElement bar = (SOAPHeaderElement)it.next();
      assertFalse(it.hasNext());

      Name fooName = new NameImpl("Foo", "ns1", "http://org.jboss.ws/header");
      Name barName = new NameImpl("Bar", "ns2", "http://org.jboss.ws/header2");

      assertEquals(fooName, foo.getElementName());
      assertEquals(barName, bar.getElementName());

      assertEquals("SomeHeaderValue", foo.getValue());
View Full Code Here

      Iterator it = soapHeader.examineHeaderElements("BradPitt");
      SOAPHeaderElement bar = (SOAPHeaderElement)it.next();
      assertFalse(it.hasNext());

      Name barName = new NameImpl("Bar", "ns2", "http://org.jboss.ws/header2");
      assertEquals(barName, bar.getElementName());

      assertEquals("SomeOtherValue", bar.getValue());

      assertTrue(soapHeader.getChildElements().hasNext());
View Full Code Here

      Iterator it = soapHeader.examineMustUnderstandHeaderElements("BradPitt");
      SOAPHeaderElement bar = (SOAPHeaderElement)it.next();
      assertFalse(it.hasNext());

      Name barName = new NameImpl("Bar", "ns2", "http://org.jboss.ws/header2");
      assertEquals(barName, bar.getElementName());

      assertEquals("SomeOtherValue", bar.getValue());

      assertTrue(soapHeader.getChildElements().hasNext());
View Full Code Here

      Iterator it = soapHeader.extractAllHeaderElements();
      SOAPHeaderElement foo = (SOAPHeaderElement)it.next();
      SOAPHeaderElement bar = (SOAPHeaderElement)it.next();
      assertFalse(it.hasNext());

      Name fooName = new NameImpl("Foo", "ns1", "http://org.jboss.ws/header");
      Name barName = new NameImpl("Bar", "ns2", "http://org.jboss.ws/header2");

      assertEquals(fooName, foo.getElementName());
      assertEquals(barName, bar.getElementName());

      assertEquals("SomeHeaderValue", foo.getValue());
View Full Code Here

      Iterator it = soapHeader.extractHeaderElements("BradPitt");
      SOAPHeaderElement bar = (SOAPHeaderElement)it.next();
      assertFalse(it.hasNext());

      Name barName = new NameImpl("Bar", "ns2", "http://org.jboss.ws/header2");
      assertEquals(barName, bar.getElementName());

      assertEquals("SomeOtherValue", bar.getValue());

      Iterator childElements = soapHeader.getChildElements();
      SOAPHeaderElement foo = (SOAPHeaderElement)childElements.next();

      Name fooName = new NameImpl("Foo", "ns1", "http://org.jboss.ws/header");
      assertEquals(fooName, foo.getElementName());
      assertFalse(childElements.hasNext());
   }
View Full Code Here

   /** Test that we can lazily create the SOAP tree
    */
   public void testChildNodeAccess() throws Exception
   {
      Name name = new NameImpl("Order", "tns", "http://someURI");

      String xmlFragment =
      "<tns:Order xmlns:tns='http://someURI'>" +
       "<OrderItem>Ferarri</OrderItem>" +
       "<OrderItem>Lamborgini</OrderItem>" +
View Full Code Here

   /** Test that we can lazily load text content
    */
   public void testTextContent() throws Exception
   {
      Name name = new NameImpl("Order", "tns", "http://someURI");
      String xmlFragment = "<tns:Order xmlns:tns='http://someURI'>No child element</tns:Order>";

      SOAPContentElement soapEl = new SOAPContentElement(name);
      soapEl.setXMLFragment(new XMLFragment(xmlFragment) );

View Full Code Here

   /** Test that we can lazily load empty elements
    */
   public void testEmptyElement() throws Exception
   {
      Name name = new NameImpl("Order", "tns", "http://someURI");
      String xmlFragment = "<tns:Order xmlns:tns='http://someURI'/>";

      SOAPContentElement soapEl = new SOAPContentElement(name);
      soapEl.setXMLFragment(new XMLFragment(xmlFragment) );

View Full Code Here

   /** Test that we get an error on bad element names
    */
   public void testBadName() throws Exception
   {
      Name name = new NameImpl("Order", "tns", "http://someURI");
      String xmlFragment = "<tns:BadName xmlns:tns='http://someURI'>No child element</tns:BadName>";

      SOAPContentElement soapEl = new SOAPContentElement(name);
      soapEl.setXMLFragment(new XMLFragment(xmlFragment) );

View Full Code Here

TOP

Related Classes of org.jboss.ws.core.soap.NameImpl

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.