Package org.codehaus.xfire.exchange

Examples of org.codehaus.xfire.exchange.MessageSerializer


    protected Source getContent(MessageContext context,
                                OutMessage message) throws XMLStreamException, IOException, XFireException {
        ByteArrayOutputStream outStream = new ByteArrayOutputStream();
        XMLStreamWriter writer = getTransformer().getOutputFactory()
            .createXMLStreamWriter(outStream, message.getEncoding());
        MessageSerializer serializer = context.getOutMessage().getSerializer();
        if (serializer == null) {
            AbstractSoapBinding binding = (AbstractSoapBinding) context.getBinding();
            if (binding == null) {
                throw new XFireException("Couldn't find the binding!");
            }
            serializer = AbstractSoapBinding.getSerializer(binding.getStyle(), binding.getUse());
        }
        serializer.writeMessage(message, writer, context);
        writer.close();
        outStream.close();
        return new StreamSource(new ByteArrayInputStream(outStream.toByteArray()));
    }
View Full Code Here


    }

    protected Source getContent(MessageContext context, OutMessage message) throws XMLStreamException, IOException, XFireException {
        ByteArrayOutputStream outStream = new ByteArrayOutputStream();
        XMLStreamWriter writer = outputFactory.createXMLStreamWriter(outStream, message.getEncoding());
        MessageSerializer serializer = context.getOutMessage().getSerializer();
        if (serializer == null)
        {
          AbstractSoapBinding binding = (AbstractSoapBinding) context.getBinding();
            if (binding == null)
            {
                throw new XFireException("Couldn't find the binding!");
            }
            serializer = AbstractSoapBinding.getSerializer(binding.getStyle(), binding.getUse());
        }
        serializer.writeMessage(message, writer, context);
        writer.close();
        outStream.close();
        StreamSource src = new StreamSource(new ByteArrayInputStream(outStream.toByteArray()));
        return src;
    }
View Full Code Here

    protected Source getContent(MessageContext context,
                                OutMessage message) throws XMLStreamException, IOException, XFireException {
        ByteArrayOutputStream outStream = new ByteArrayOutputStream();
        XMLStreamWriter writer = getTransformer().getOutputFactory()
            .createXMLStreamWriter(outStream, message.getEncoding());
        MessageSerializer serializer = context.getOutMessage().getSerializer();
        if (serializer == null) {
            AbstractSoapBinding binding = (AbstractSoapBinding) context.getBinding();
            if (binding == null) {
                throw new XFireException("Couldn't find the binding!");
            }
            serializer = AbstractSoapBinding.getSerializer(binding.getStyle(), binding.getUse());
        }
        serializer.writeMessage(message, writer, context);
        writer.close();
        outStream.close();
        return new StreamSource(new ByteArrayInputStream(outStream.toByteArray()));
    }
View Full Code Here

        return c;
    }

    public MessageSerializer getSerializer(OperationInfo operation)
    {
        MessageSerializer ser = (MessageSerializer) op2serializer.get(operation);
        if (ser == null)
        {
            ser = getSerializer();
        }
       
View Full Code Here

        {
            throw new XFireFault("Could not find appropriate binding for service: " + context.getService().getName(),
                                 XFireFault.RECEIVER);
        }
       
        MessageSerializer ser = binding.getSerializer(context.getExchange().getOperation());

        ser.readMessage(context.getInMessage(), context);
    }
View Full Code Here

     */
    public void invoke(MessageContext context)
        throws Exception
    {
        OutMessage msg = (OutMessage) context.getExchange().getFaultMessage();
        MessageSerializer serializer = msg.getSerializer();

        msg.setSerializer(new SoapSerializer(serializer));
    }
View Full Code Here

     * @throws XFireFault
     */
    public void invoke(MessageContext context)
        throws Exception
    {
        MessageSerializer serializer = context.getOutMessage().getSerializer();
        if (serializer == null)
        {
            AbstractSoapBinding binding = (AbstractSoapBinding) context.getBinding();
            if (binding == null)
            {
View Full Code Here

    {
        if (reader.getEventType() == XMLStreamReader.START_ELEMENT)
        {
            if (reader.getName().equals(msg.getSoapVersion().getFault()))
            {
                MessageSerializer serializer = context.getService().getFaultSerializer();
               
                serializer.readMessage(msg, context);
               
                throw (XFireFault) msg.getBody();
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.codehaus.xfire.exchange.MessageSerializer

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.