Package org.jboss.ws.util.xml

Examples of org.jboss.ws.util.xml.BufferedStreamResult


         throw new IllegalArgumentException("SOAPElement value cannot be null");
      if ((value instanceof SOAPElement) == false)
         throw new IllegalArgumentException("Value is not a SOAPElement: " + value.getClass().getName());

      String xmlFragment = DOMWriter.printNode((SOAPElement)value, false);
      return new BufferedStreamResult(xmlFragment);
   }
View Full Code Here


         StringWriter strwr = new StringWriter();
         delegate.marshal(value, strwr);
         String xmlFragment = strwr.toString();

         log.debug("serialized: " + xmlFragment);
         return new BufferedStreamResult(xmlFragment);
      }
      catch (RuntimeException rte)
      {
         throw rte;
      }
View Full Code Here

         marshaller.setProperty(Marshaller.JAXB_FRAGMENT, true);
         marshaller.setAttachmentMarshaller(new AttachmentMarshallerImpl());

         // It's safe to pass a stream result, because the SCE will always be in XML_VALID state afterwards.
         // This state can safely be written to an outstream. See XMLFragment and XMLContent as well.
         result = new BufferedStreamResult();
         marshaller.marshal(new JAXBElement(xmlName, expectedType, value), result);

         if (log.isDebugEnabled()) log.debug("serialized: " + result);
      }
      catch (Exception ex)
View Full Code Here

         DOMResult domResult = (DOMResult)result;
         source = new DOMSource(domResult.getNode());
      }
      else if (result instanceof BufferedStreamResult)
      {
         BufferedStreamResult br = (BufferedStreamResult)result;
         ByteArrayOutputStream baos = (ByteArrayOutputStream)br.getOutputStream();
         source = new BufferedStreamSource(baos.toByteArray());
      }
      else
      {
         throw new IllegalArgumentException("Unsupported result type: " + result);
View Full Code Here

        SOAPMessageContextJAXWS messageContext = new SOAPMessageContextJAXWS();
        QName portTypeName = new QName("http://jbossws.jboss.org", "GetSedans");
        EndpointMetaData endpointMetaData = new MockEndpointMetaData(portTypeName);
        messageContext.setEndpointMetaData(endpointMetaData);
        MessageContextAssociation.pushMessageContext(messageContext);
        BufferedStreamResult result = (BufferedStreamResult)serializer.serialize(qname, null, response, context, null);
        Element element = DOMUtils.parse(result.toString());
        List<Element> elements = DOMUtils.getChildElementsAsList(element, "return");
        for (Element ele : elements)
        { 
           String typeValue = DOMUtils.getAttributeValue(ele, new QName("http://www.w3.org/2001/XMLSchema-instance", "type"));
           assertEquals("The namespace prefix is not serialized", true ,typeValue.indexOf(":") > 0);
View Full Code Here

         marshaller.setProperty(Marshaller.JAXB_FRAGMENT, true);
         marshaller.setAttachmentMarshaller(new AttachmentMarshallerImpl());

         // It's safe to pass a stream result, because the SCE will always be in XML_VALID state afterwards.
         // This state can safely be written to an outstream. See XMLFragment and XMLContent as well.
         result = new BufferedStreamResult();
         marshaller.marshal(new JAXBElement(xmlName, expectedType, value), result);

         if (log.isDebugEnabled()) log.debug("serialized: " + result);
      }
      catch (Exception ex)
View Full Code Here

         DOMResult domResult = (DOMResult)result;
         source = new DOMSource(domResult.getNode());
      }
      else if (result instanceof BufferedStreamResult)
      {
         BufferedStreamResult br = (BufferedStreamResult)result;
         ByteArrayOutputStream baos = (ByteArrayOutputStream)br.getOutputStream();
         source = new BufferedStreamSource(baos.toByteArray());
      }
      else
      {
         throw new IllegalArgumentException("Unsupported result type: " + result);
View Full Code Here

TOP

Related Classes of org.jboss.ws.util.xml.BufferedStreamResult

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.