Package org.jibx.ws.example.headers.common

Examples of org.jibx.ws.example.headers.common.Locale


     * @param inCtx inbound message context
     * @param outCtx outbound message context
     * @return welcome message
     */
    public Welcome welcomeService(Greetee greeetee, InContext inCtx, OutContext outCtx) {
        Locale locale = (Locale) inCtx.getAttribute("example.locale");
        QOS qos = null;
        String greeting = "Hi";
        if (locale != null) {
            if (locale.getLanguage().equals("en")) {
                greeting = "Hello";
                qos = new QOS(8, "OK");
            } else if (locale.getLanguage().equals("fr")) {
                greeting = "Bonjour";
                qos = new QOS(9, "Très bon");
            }
        }
        outCtx.setAttribute("comm.qos", qos);
View Full Code Here


        m_fact = BindingDirectory.getFactory(Greetee.class);
    }

    private Welcome sayHello(Greetee s) throws WsException, IOException {
        SoapClient client = new SoapClient(m_location, m_fact);
        client.addOutHeader(new Locale("fr"));
        UnmarshallingInHandler headerHandler = new UnmarshallingInHandler(QOS.class);
        client.addInHeaderHandler(headerHandler);
        Welcome welcome = (Welcome) client.call(s);
        System.out.println("QOS: " + headerHandler.getPayload());
        return welcome;
View Full Code Here

TOP

Related Classes of org.jibx.ws.example.headers.common.Locale

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.