Package demo.hw.server

Source Code of demo.hw.server.GreeterImpl

package demo.hw.server;

import java.util.logging.Logger;
import org.objectweb.hello_world_xml_http.wrapped.Greeter;
import org.objectweb.hello_world_xml_http.wrapped.PingMeFault;
import org.objectweb.hello_world_xml_http.wrapped.types.FaultDetail;

@javax.jws.WebService(name = "Greeter", serviceName = "XMLService",
                      targetNamespace = "http://objectweb.org/hello_world_xml_http/wrapped",
                      wsdlLocation = "file:./wsdl/hello_world.wsdl")

@javax.xml.ws.BindingType(value = "http://celtix.objectweb.org/bindings/xmlformat")
public class GreeterImpl implements Greeter {

    private static final Logger LOG =
        Logger.getLogger(GreeterImpl.class.getPackage().getName());

    /* (non-Javadoc)
     * @see org.objectweb.hello_world_xml_http.wrapped.Greeter#greetMe(java.lang.String)
     */
    public String greetMe(String me) {
        LOG.info("Executing operation greetMe");
        System.out.println("Executing operation greetMe");
        System.out.println("Message received: " + me + "\n");
        return "Hello " + me;
    }

    /* (non-Javadoc)
     * @see org.objectweb.hello_world_xml_http.wrapped.Greeter#greetMeOneWay(java.lang.String)
     */
    public void greetMeOneWay(String me) {
        LOG.info("Executing operation greetMeOneWay");
        System.out.println("Executing operation greetMeOneWay\n");
        System.out.println("Hello there " + me);
    }

    /* (non-Javadoc)
     * @see org.objectweb.hello_world_xml_http.wrapped.Greeter#sayHi()
     */
    public String sayHi() {
        LOG.info("Executing operation sayHi");
        System.out.println("Executing operation sayHi\n");
        return "Bonjour";
    }

    public void pingMe() throws PingMeFault {
        FaultDetail faultDetail = new FaultDetail();
        faultDetail.setMajor((short)2);
        faultDetail.setMinor((short)1);
        LOG.info("Executing operation pingMe, throwing PingMeFault exception");
        System.out.println("Executing operation pingMe, throwing PingMeFault exception\n");
        throw new PingMeFault("PingMeFault raised by server", faultDetail);
    }
}
TOP

Related Classes of demo.hw.server.GreeterImpl

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.