Examples of XMLFragment


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

      Result result = ser.serialize(xmlName, xmlType, value, serContext, null);
      assertNotNull(result);

      AbstractDeserializerFactory deserializerFactory = (AbstractDeserializerFactory)typeMapping.getDeserializer(URI.class, xmlType);
      DeserializerSupport des = (DeserializerSupport)deserializerFactory.getDeserializer();
      Source source = new StreamSource(new ByteArrayInputStream( new XMLFragment(result).toXMLString().getBytes()));
      URI out = (URI)des.deserialize(xmlName, xmlType, source, serContext);

      assertEquals(value, out);
   }
View Full Code Here

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

      Result result = ser.serialize(xmlName, xmlType, value, serContext, null);
      assertNotNull(result);

      AbstractDeserializerFactory deserializerFactory = (AbstractDeserializerFactory)typeMapping.getDeserializer(byte[].class, xmlType);
      DeserializerSupport des = (DeserializerSupport)deserializerFactory.getDeserializer();
      Source source = new StreamSource(new ByteArrayInputStream( new XMLFragment(result).toXMLString().getBytes()));
      byte[] out = (byte[])des.deserialize(xmlName, xmlType, source, serContext);

      assertEquals(new String(value), new String(out));
   }
View Full Code Here

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

      Result result = ser.serialize(xmlName, xmlType, value, serContext, null);
      assertNotNull(result);

      AbstractDeserializerFactory deserializerFactory = (AbstractDeserializerFactory)typeMapping.getDeserializer(byte[].class, xmlType);
      DeserializerSupport des = (DeserializerSupport)deserializerFactory.getDeserializer();
      Source source = new StreamSource(new ByteArrayInputStream( new XMLFragment(result).toXMLString().getBytes()));
      byte[] out = (byte[])des.deserialize(xmlName, xmlType, source, serContext);

      assertEquals(new String(value), new String(out));
   }
View Full Code Here

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

        "<Name>Thomas</Name>" +
       "</Customer>" +
      "</tns:Order>";

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

      assertEquals(name, soapEl.getElementName());

      Iterator it = soapEl.getChildElements();
      SOAPElement child1 = (SOAPElement)it.next();
View Full Code Here

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

   {
      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) );

      assertEquals(name, soapEl.getElementName());
      assertEquals("No child element", soapEl.getValue());
   }
View Full Code Here

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

   {
      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) );

      assertEquals(name, soapEl.getElementName());
      assertFalse(soapEl.hasChildNodes());
      assertNull(soapEl.getValue());
   }
View Full Code Here

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

   {
      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) );

      try
      {
         assertEquals(name, soapEl.getElementName());
         assertEquals("No child element", soapEl.getValue());
View Full Code Here

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

      Name name = new NameImpl("Bar", "ns2", "http://org.jboss.ws/header2");
      String xmlFragment = "<ns2:Bar xmlns:ns2='http://org.jboss.ws/header2' foo='Kermit'>SomeOtherValue</ns2:Bar>";

      SOAPContentElement soapEl = new SOAPContentElement(name);
      soapEl.setAttribute("foo", "Kermit");
      soapEl.setXMLFragment(new XMLFragment(xmlFragment) );
      assertEquals(name, soapEl.getElementName());

      assertEquals("Kermit", soapEl.getAttributeValue(new NameImpl("foo")));
      assertEquals("SomeOtherValue", soapEl.getValue());
   }
View Full Code Here

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

      try
      {
         SerializerSupport ser = serFactory.getSerializer();
         Result result = ser.serialize(xmlName, xmlType, faultObject, serContext, null);
         XMLFragment xmlFragment = new XMLFragment(result);
         String xmlStr = xmlFragment.toXMLString();
         log.debug("Fault detail: " + xmlStr);

         Element domElement = xmlFragment.toElement();
         SOAPFactoryImpl soapFactory = new SOAPFactoryImpl();
         return soapFactory.createElement(domElement);
      }
      catch (BindingException e)
      {
View Full Code Here

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

         "<return>WSEjbWebServiceProvider-SayHello</return></ns2:sayHelloResponse>";
  
   public void testDOMSourceFragment() throws Exception
   {
      Element srcElement = DOMUtils.parse(XML_STRING);
      XMLFragment xmlFragment = new XMLFragment( new DOMSource(srcElement) );
      testSourceAPI(xmlFragment);
   }
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.