Examples of OutMessage


Examples of org.codehaus.xfire.exchange.OutMessage

    }

    public void testService()
            throws Exception
    {
        OutMessage msg = new OutMessage("http://localhost:8081/PictureService");
        msg.setBody(STAXUtils.createXMLStreamReader(getResourceAsReader("GetPicture.xml")));
       
        // MTOM shouldn't work locally, but things should still work...
        InMessage res = invokeService(msg, HttpTransport.HTTP_BINDING);

        Attachments atts = res.getAttachments();
View Full Code Here

Examples of org.codehaus.xfire.exchange.OutMessage

   
        WSS4JOutHandler handler = new WSS4JOutHandler();
   
        MessageContext ctx = new MessageContext();
   
        OutMessage msg = new OutMessage("");
        msg.setProperty(DOMOutHandler.DOM_MESSAGE, doc);
   
        ctx.setCurrentMessage(msg);
        ctx.setProperty(WSHandlerConstants.ACTION, WSHandlerConstants.USERNAME_TOKEN);
        ctx.setProperty(WSHandlerConstants.SIG_PROP_FILE, "META-INF/xfire/outsecurity.properties");
        ctx.setProperty(WSHandlerConstants.USER, "username");
View Full Code Here

Examples of org.codehaus.xfire.exchange.OutMessage

   
        WSS4JOutHandler handler = new WSS4JOutHandler();
   
        MessageContext ctx = new MessageContext();
   
        OutMessage msg = new OutMessage("");
        msg.setProperty(DOMOutHandler.DOM_MESSAGE, doc);
   
        ctx.setCurrentMessage(msg);
        ctx.setProperty(WSHandlerConstants.ACTION, WSHandlerConstants.ENCRYPT);
        ctx.setProperty(WSHandlerConstants.SIG_PROP_FILE, "META-INF/xfire/outsecurity.properties");
        ctx.setProperty(WSHandlerConstants.ENC_PROP_FILE, "META-INF/xfire/outsecurity.properties");
View Full Code Here

Examples of org.codehaus.xfire.exchange.OutMessage

   
        WSS4JOutHandler handler = new WSS4JOutHandler();
   
        MessageContext ctx = new MessageContext();
   
        OutMessage msg = new OutMessage("");
        msg.setProperty(DOMOutHandler.DOM_MESSAGE, doc);
   
        ctx.setCurrentMessage(msg);
        ctx.setProperty(WSHandlerConstants.ACTION, WSHandlerConstants.SIGNATURE);
        ctx.setProperty(WSHandlerConstants.SIG_PROP_FILE, "META-INF/xfire/outsecurity.properties");
        ctx.setProperty(WSHandlerConstants.USER, "myAlias");
View Full Code Here

Examples of org.codehaus.xfire.exchange.OutMessage

   
        WSS4JOutHandler handler = new WSS4JOutHandler();
   
        MessageContext ctx = new MessageContext();
   
        OutMessage msg = new OutMessage("");
        msg.setProperty(DOMOutHandler.DOM_MESSAGE, doc);
   
        ctx.setCurrentMessage(msg);
        handler.setProperty(WSHandlerConstants.ACTION, WSHandlerConstants.TIMESTAMP);
        handler.setProperty(WSHandlerConstants.SIG_PROP_FILE, "META-INF/xfire/outsecurity.properties");
        ctx.setProperty(WSHandlerConstants.USER, "myAlias");
View Full Code Here

Examples of org.codehaus.xfire.exchange.OutMessage

      }
    }

    private void invokeServer(MessageContext context)
    {
        OutMessage msg = (OutMessage) context.getCurrentMessage();
        AddressingHeaders headers = (AddressingHeaders) msg.getProperty(AddressingInHandler.ADRESSING_HEADERS);
        AddressingHeadersFactory factory = (AddressingHeadersFactory) msg.getProperty(AddressingInHandler.ADRESSING_FACTORY);
       
        if (headers == null)
        {
            logger.debug("Couldn't find addressing headers.");
            return;
        }
       
        if (msg == null)
        {
            logger.warn("There was no out message!");
            return;
        }

        factory.writeHeaders(msg.getOrCreateHeader(), headers);
    }
View Full Code Here

Examples of org.codehaus.xfire.exchange.OutMessage

        headers.setFaultTo(aoi.getFaultTo());
        headers.setFrom(aoi.getFrom());
        headers.setMessageID("urn:uuid:" + new RandomGUID(false).toString());
        context.setId(headers.getMessageID());
       
        OutMessage msg = (OutMessage) context.getCurrentMessage();

        if (msg == null)
        {
            logger.warn("There was no out message!");
        }
        else
        {
            factory.writeHeaders(msg.getOrCreateHeader(), headers);
        }
    }
View Full Code Here

Examples of org.codehaus.xfire.exchange.OutMessage

                    MessageExchange exchange = context.getExchange();
                    exchange.setOperation(aop.getOperationInfo());

                    EndpointReference faultTo = headers.getFaultTo();
                    OutMessage faultMsg = null;
                    if (faultTo != null)
                    {
                        faultMsg = processEPR(context, faultTo, aop, headers, factory);
                    }
                    else
                    {
                        faultMsg = createDefaultMessage(context, aop, headers, factory);
                    }
                    exchange.setFaultMessage(faultMsg);

                    EndpointReference replyTo = headers.getReplyTo();
                    OutMessage outMessage = null;
                    if (replyTo != null)
                    {
                        outMessage = processEPR(context, replyTo, aop, headers, factory);
                    }
                    else
View Full Code Here

Examples of org.codehaus.xfire.exchange.OutMessage

    private OutMessage createDefaultMessage(MessageContext context,
                                            AddressingOperationInfo aoi,
                                            AddressingHeaders inHeaders,
                                            AddressingHeadersFactory factory)
    {
        OutMessage outMessage = context.getOutMessage();

        AddressingHeaders headers = new AddressingHeaders();
        headers.setTo(factory.getAnonymousUri());
        headers.setRelatesTo(inHeaders.getMessageID());
       
        headers.setAction(aoi.getOutAction());
        outMessage.setProperty(ADRESSING_HEADERS, headers);
        outMessage.setProperty(ADRESSING_FACTORY, factory);

        return outMessage;
    }
View Full Code Here

Examples of org.codehaus.xfire.exchange.OutMessage

                                    AddressingHeaders inHeaders,
                                    AddressingHeadersFactory factory)
        throws XFireFault, Exception
    {
        String addr = epr.getAddress();
        OutMessage outMessage = null;

        boolean isFault = epr.getName().equals(WSAConstants.WSA_FAULT_TO);
        Transport t = null;
        Channel c = null;
       
        if (addr == null)
        {
            throw new XFireFault("Invalid ReplyTo address.", XFireFault.SENDER);
        }
       
        if (addr.equals(factory.getAnonymousUri()))
        {
            outMessage = new OutMessage(Channel.BACKCHANNEL_URI);
            c = context.getInMessage().getChannel();
            t = c.getTransport();
        }
        else
        {
            if (isNoneAddress(factory, addr))
            {
                t = new DeadLetterTransport();
                outMessage = new OutMessage(addr);
                c = t.createChannel();
            }
            else
            {
                outMessage = new OutMessage(addr);
                t = context.getXFire().getTransportManager().getTransportForUri(addr);
                c = t.createChannel();
            }
        }
       
        outMessage.setChannel(c);
        outMessage.setSoapVersion(context.getExchange().getInMessage().getSoapVersion());

        if (t == null)
        {
            throw new XFireFault("URL was not recognized: " + addr, XFireFault.SENDER);
        }

        AddressingHeaders headers = new AddressingHeaders();
        // Fault can have only refrenceParameters
        if (!isFault)
        {
            headers.setTo(addr);
            headers.setAction(aoi.getOutAction());
        }
        else
        {
            headers.setAction(WSAConstants.WSA_200508_FAULT_ACTION);
        }
        //headers.setMessageID("urn:uuid:" + guidGenerator.toString());
        headers.setMessageID("urn:uuid:" +new RandomGUID(false).toString());
        headers.setRelatesTo(inHeaders.getMessageID());

        Element refParam = epr.getReferenceParametersElement();
        if (refParam != null)
        {
            List refs = refParam.cloneContent();

            List params = new ArrayList();
            for (int i = 0; i < refs.size(); i++)
            {
                if (refs.get(i) instanceof Element)
                {
                    Element e = (Element) refs.get(i);
                    e.setAttribute(new Attribute(WSAConstants.WSA_IS_REF_PARAMETER, "true", epr.getNamespace()));
                    params.add(e);
                }

            }
            headers.setReferenceParameters(params);
        }

        outMessage.setProperty(ADRESSING_HEADERS, headers);
        outMessage.setProperty(ADRESSING_FACTORY, factory);

        return outMessage;
    }
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.