Examples of AxisEngine


Examples of org.apache.axis.AxisEngine

                }
            }
        }

        String rootNS = root.getNamespaceURI();
        AxisEngine engine = msgContext.getAxisEngine();

        // If this is WSDD, process it correctly.
        if (rootNS != null && rootNS.equals(WSDDConstants.URI_WSDD)) {
            return processWSDD(msgContext, engine, root);
        }
View Full Code Here

Examples of org.apache.axis.AxisEngine

            // System.exit( 1 );
        }

        Admin admin = new Admin();

        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 {
            for ( i = 1 ; i < args.length ; i++ ) {
                if (log.isDebugEnabled())
View Full Code Here

Examples of org.apache.axis.AxisEngine

        PrintWriter writer = response.getWriter();

        try
        {
            AxisEngine engine = getEngine();
            ServletContext servletContext =
                getServletConfig().getServletContext();

            String pathInfo = request.getPathInfo();
            String realpath = servletContext.getRealPath(request.getServletPath());
            if (realpath == null) {
                realpath = request.getServletPath();
            }

            boolean wsdlRequested = false;
            boolean listRequested = false;
            boolean hasParameters = request.getParameterNames().hasMoreElements();

            //JWS pages are special; they are the servlet path and there
            //is no pathinfo...we map the pathinfo to the servlet path to keep
            //it happy
            boolean isJWSPage = request.getRequestURI().endsWith(".jws");
            if(isJWSPage) {
                pathInfo= request.getServletPath();
            }

            // check first if we are doing WSDL or a list operation
            String queryString = request.getQueryString();
            if (queryString != null) {
                if (queryString.equalsIgnoreCase("wsdl")) {
                    wsdlRequested = true;
                } else if (queryString.equalsIgnoreCase("list")) {
                    listRequested = true;
                }
            }

            boolean hasNoPath = (pathInfo == null || pathInfo.equals(""));
            if (!wsdlRequested && !listRequested && hasNoPath) {
                // If the user requested the servlet (i.e. /axis/servlet/AxisServlet)
                // with no service name, present the user with a list of deployed
                // services to be helpful
                // Don't do this if we are doing WSDL or list.
                reportAvailableServices(response, writer, request);
            } else if (realpath != null) {
                // We have a pathname, so now we perform WSDL or list operations

                // get message context w/ various properties set
                MessageContext msgContext = createMessageContext(engine, request, response);

                try {
                    // NOTE:  HttpUtils.getRequestURL has been deprecated.
                    // This line SHOULD be:
                    //    String url = req.getRequestURL().toString()
                    // HOWEVER!!!!  DON'T REPLACE IT!  There's a bug in
                    // req.getRequestURL that is not in HttpUtils.getRequestURL
                    // req.getRequestURL returns "localhost" in the remote
                    // scenario rather than the actual host name.
                    //
                    // ? Still true?  For which JVM's?
                    String url = HttpUtils.getRequestURL(request).toString();

                    msgContext.setProperty(MessageContext.TRANS_URL, url);


                    if (wsdlRequested) {
                        // Do WSDL generation
                        processWsdlRequest(msgContext, response, writer);
                    } else if (listRequested) {
                        // Do list, if it is enabled
                        processListRequest(response, writer);
                    } else if (hasParameters) {
                        // If we have ?method=x&param=y in the URL, make a stab
                        // at invoking the method with the parameters specified
                        // in the URL

                        processMethodRequest(msgContext, request, response, writer);

                    } else {

                        // See if we can locate the desired service.  If we
                        // can't, return a 404 Not Found.  Otherwise, just
                        // print the placeholder message.

                        String serviceName;
                        if (pathInfo.startsWith("/")) {
                            serviceName = pathInfo.substring(1);
                        } else {
                            serviceName = pathInfo;
                        }

                        SOAPService s = engine.getService(serviceName);
                        if (s == null) {
                            // no such service....
                            response.setStatus(java.net.HttpURLConnection.HTTP_NOT_FOUND);
                            response.setContentType("text/html");
                            writer.println("<h2>" +
View Full Code Here

Examples of org.apache.axis.AxisEngine

     * during WSDL generation
     */
    protected void processWsdlRequest(MessageContext msgContext,
                                      HttpServletResponse response,
                                      PrintWriter writer) throws AxisFault {
        AxisEngine engine = getEngine();
        try {
            engine.generateWSDL(msgContext);
            Document doc = (Document) msgContext.getProperty("WSDL");
            if (doc != null) {
                response.setContentType("text/xml");
                XMLUtils.DocumentToWriter(doc, writer);
            } else {
View Full Code Here

Examples of org.apache.axis.AxisEngine

    protected void invokeEndpointFromGet(MessageContext msgContext,
                                       HttpServletResponse response,
                                       PrintWriter writer,
                                       String method,
                                       String args) throws AxisFault {
        AxisEngine engine = getEngine();
        String body =
            "<" + method + ">" + args + "</" + method + ">";

        String msgtxt =
            "<SOAP-ENV:Envelope" +
            " xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\">" +
            "<SOAP-ENV:Body>" + body + "</SOAP-ENV:Body>" +
            "</SOAP-ENV:Envelope>";

        ByteArrayInputStream istream =
            new ByteArrayInputStream(msgtxt.getBytes());

        Message msg = new Message(istream, false);
        msgContext.setRequestMessage(msg);
        engine.invoke(msgContext);
        Message respMsg = msgContext.getResponseMessage();
        if (respMsg != null) {
            response.setContentType("text/xml");
            writer.println(respMsg.getSOAPPartAsString());
        } else {
View Full Code Here

Examples of org.apache.axis.AxisEngine

     * @param response
     * @param writer
     * @throws AxisFault
     */
    protected void processListRequest(HttpServletResponse response, PrintWriter writer) throws AxisFault {
        AxisEngine engine = getEngine();
        if (enableList) {
            Document doc = Admin.listConfig(engine);
            if (doc != null) {
                response.setContentType("text/xml");
                XMLUtils.DocumentToWriter(doc, writer);
View Full Code Here

Examples of org.apache.axis.AxisEngine

     */
    protected void reportAvailableServices(HttpServletResponse response,
                                       PrintWriter writer,
                                       HttpServletRequest request)
            throws ConfigurationException, AxisFault {
        AxisEngine engine = getEngine();
        response.setContentType("text/html");
        writer.println("<h2>And now... Some Services</h2>");
        Iterator i = engine.getConfig().getDeployedServices();
        String baseURL = getWebappBase(request)+"/services/";
        writer.println("<ul>");
        while (i.hasNext()) {
            ServiceDesc sd = (ServiceDesc)i.next();
            StringBuffer sb = new StringBuffer();
View Full Code Here

Examples of org.apache.axis.AxisEngine

        Message responseMsg = null;
        String  contentType = null;

        try {
            AxisEngine engine = getEngine();

            if (engine == null) {
                // !!! should return a SOAP fault...
                ServletException se =
                    new ServletException(Messages.getMessage("noEngine00"));
                log.debug("No Engine!", se);
                throw se;
            }

            res.setBufferSize(1024 * 8); // provide performance boost.

            /** get message context w/ various properties set
             */
            msgContext = createMessageContext(engine, req, res);

            // ? OK to move this to 'getMessageContext',
            // ? where it would also be picked up for 'doGet()' ?
            if (securityProvider != null) {
                if (isDebug) log.debug("securityProvider:" + securityProvider);
                msgContext.setProperty("securityProvider", securityProvider);
            }

            /* Get request message
             */
            Message requestMsg =
                new Message(req.getInputStream(),
                            false,
                            req.getHeader(HTTPConstants.HEADER_CONTENT_TYPE),
                            req.getHeader(HTTPConstants.HEADER_CONTENT_LOCATION));

            if(isDebug) log.debug("Request Message:" + requestMsg);

            /* Set the request(incoming) message field in the context */
            /**********************************************************/
            msgContext.setRequestMessage(requestMsg);

            try {
                /**
                 * Save the SOAPAction header in the MessageContext bag.
                 * This will be used to tell the Axis Engine which service
                 * is being invoked.  This will save us the trouble of
                 * having to parse the Request message - although we will
                 * need to double-check later on that the SOAPAction header
                 * does in fact match the URI in the body.
                 */
                // (is this last stmt true??? (I don't think so - Glen))
                /********************************************************/
                soapAction = getSoapAction(req);

                if (soapAction != null) {
                    msgContext.setUseSOAPAction(true);
                    msgContext.setSOAPActionURI(soapAction);
                }

                // Create a Session wrapper for the HTTP session.
                // These can/should be pooled at some point.
                // (Sam is Watching! :-)
                msgContext.setSession(new AxisHttpSession(req));

                if( tlog.isDebugEnabled() ) {
                    t1=System.currentTimeMillis();
                }
                /* Invoke the Axis engine... */
                /*****************************/
                if(isDebug) log.debug("Invoking Axis Engine.");
                engine.invoke(msgContext);
                if(isDebug) log.debug("Return from Axis Engine.");
                if( tlog.isDebugEnabled() ) {
                    t2=System.currentTimeMillis();
                }

View Full Code Here

Examples of org.apache.axis.AxisEngine

    if (log.isDebugEnabled()) {
      log.debug("Enter: SimpleAsyncCall::invoke");
    }
     
    final AxisEngine engine = this.engine;
    final Runnable task = new Runnable() {
      public void run() {
        if (log.isDebugEnabled()) {
          log.debug("Enter: SimpleAsyncCall::invoke(Runnable::run)");
        }
        try {
          engine.invoke(context);
          if (context.getResponseMessage() != null) {
            listener.onResponse(context);
          } else {
          }
        } catch (AxisFault fault) {
View Full Code Here

Examples of org.apache.axis.AxisEngine

                scopeHolder.value = Scope.DEFAULT.getValue();
                return getNewServiceObject(msgContext, clsName);
            }
        } else if (scope == Scope.APPLICATION) {
            // MUST be AxisEngine here!
            AxisEngine engine = msgContext.getAxisEngine();
            Session appSession = engine.getApplicationSession();
            if (appSession != null) {
                // This part isn't thread safe
                synchronized (appSession) {
                    // store service objects in session, indexed by class name
                    Object obj = appSession.get(serviceName);
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.