Examples of AxisServer


Examples of org.apache.axis.server.AxisServer

        AxisEngine engine;
        if ( args[0].equals("client") )
            engine = new AxisClient();
        else
            engine = new AxisServer();
        engine.setShouldSaveConfig(true);
        engine.init();
        MessageContext msgContext = new MessageContext(engine);

        try {
View Full Code Here

Examples of org.apache.axis.server.AxisServer

    /**
     * Allocate an embedded Axis server to process requests and initialize it.
     */
    public synchronized void init() {
        this.server= new AxisServer();
    }
View Full Code Here

Examples of org.apache.axis.server.AxisServer

    public void invoke(MessageContext clientContext) throws AxisFault {
        if (log.isDebugEnabled()) {
            log.debug("Enter: LocalSender::invoke");
        }

        AxisServer targetServer =
            (AxisServer)clientContext.getProperty(LocalTransport.LOCAL_SERVER);

        if (log.isDebugEnabled()) {
            log.debug(Messages.getMessage("usingServer00",
                "LocalSender", "" + targetServer));
        }

        if (targetServer == null) {
            // This should have already been done, but it doesn't appear to be
            // something that can be relied on.  Oh, well...
            if (server == null) init();
            targetServer = server;
        }

        // Define a new messageContext per request
        MessageContext serverContext = new MessageContext(targetServer);

        // copy the request, and force its format to String in order to
        // exercise the serializers.
        String msgStr = clientContext.getRequestMessage().getSOAPPartAsString();

        if (log.isDebugEnabled()) {
            log.debug(Messages.getMessage("sendingXML00", "LocalSender"));
            log.debug(msgStr);
        }

        serverContext.setRequestMessage(new Message(msgStr));
        serverContext.setTransportName("local");

        // Also copy authentication info if present
        String user = clientContext.getUsername();
        if (user != null) {
            serverContext.setUsername(user);
            String pass = clientContext.getPassword();
            if (pass != null)
                serverContext.setPassword(pass);
        }

        // set the realpath if possible
        String transURL = clientContext.getStrProp(MessageContext.TRANS_URL);
        if (transURL != null) {
            try {
                URL url = new URL(transURL);
                String file = url.getFile();
                if (file.length()>0 && file.charAt(0)=='/') file = file.substring(1);
                serverContext.setProperty(Constants.MC_REALPATH, file);
               
                // This enables "local:///AdminService" and the like to work.
                serverContext.setTargetService(file);
            } catch (Exception e) {
                throw AxisFault.makeFault(e);
            }
        }

        // If we've been given an explicit "remote" service to invoke,
        // use it. (Note that right now this overrides the setting above;
        // is this the correct precedence?)
        String remoteService = clientContext.getStrProp(LocalTransport.REMOTE_SERVICE);
        if (remoteService != null)
            serverContext.setTargetService(remoteService);

        // invoke the request
        try {
            targetServer.invoke(serverContext);
        } catch (AxisFault fault) {
            Message respMsg = serverContext.getResponseMessage();
            if (respMsg == null) {
                respMsg = new Message(fault);
                serverContext.setResponseMessage(respMsg);
View Full Code Here

Examples of org.apache.axis.server.AxisServer

     * @todo add catch for not being able to cast the context attr to an
     * engine and reinit the engine if so.
     */
    public static AxisServer getEngine(HttpServlet servlet) throws AxisFault
    {
        AxisServer engine = null;
        if (isDebug)
            log.debug("Enter: getEngine()");

        ServletContext context = servlet.getServletContext();
        synchronized (context) {
View Full Code Here

Examples of org.apache.axis.server.AxisServer

    // Axis server (shared between instances)
    private static AxisServer myAxisServer = null;

    protected static synchronized AxisServer getAxisServer() {
        if (myAxisServer == null) {
            myAxisServer = new AxisServer();
        }
        return myAxisServer;
    }
View Full Code Here

Examples of org.apache.axis.server.AxisServer

        throws ServletException, IOException {
        response.setContentType("text/html");
        StringBuffer buffer=new StringBuffer(512);
        buffer.append("<html><head><title>Axis</title></head><body>\n");
        //REVISIT: what happens if there is no engine?
        AxisServer server = getEngine();

        //process command
        String cmd = request.getParameter("cmd");
        if (cmd != null) {
            //who called?
            String callerIP=request.getRemoteAddr();
            if (isDevelopment()) {
                //only in dev mode do these command work
                if (cmd.equals("start")) {
                    log.info(Messages.getMessage("adminServiceStart", callerIP));
                    server.start();
                }
                else if (cmd.equals("stop")) {
                    log.info(Messages.getMessage("adminServiceStop", callerIP));
                    server.stop();
                }
            } else {
                //in production we log a hostile probe. Remember: logs can be
                //used for DoS attacks themselves.
                log.info(Messages.getMessage("adminServiceDeny", callerIP));
            }
        }

        // display status
        if (server.isRunning()) {
            buffer.append(Messages.getMessage("serverRun00"));
        }
        else {
            buffer.append(Messages.getMessage("serverStop00"));
        }
View Full Code Here

Examples of org.apache.axis.server.AxisServer

    private class TestMessageContext extends MessageContext {

        private int hcount = 0;

        public TestMessageContext() {
            super(new AxisServer());
        }
View Full Code Here

Examples of org.apache.axis.server.AxisServer

            e.printStackTrace();
            return;
        }

        // create the msg and context and invoke the server
        AxisServer server = listener.getAxisServer();
        Message msg = new Message(in);
        MessageContext  msgContext = new MessageContext(server);
        msgContext.setRequestMessage( msg );
        try
        {
            server.invoke( msgContext );
            msg = msgContext.getResponseMessage();
        }
        catch (AxisFault af)
        {
            msg = new Message(af);
View Full Code Here

Examples of org.apache.axis.server.AxisServer

     * @throws Exception
     */
    protected void setUp(boolean deploy) throws Exception {
        super.setUp();
        config = new BasicServerConfig();
        server = new AxisServer(config);
        transport = new LocalTransport(server);
       
        if (deploy)
            deploy();
    }
View Full Code Here

Examples of org.apache.axis.server.AxisServer

    // Axis server (shared between instances)
    private static AxisServer myAxisServer = null;

    protected static synchronized AxisServer getAxisServer() {
        if (myAxisServer == null) {
            myAxisServer = new AxisServer();
        }
        return myAxisServer;
    }
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.