Package org.apache.axis2.util

Examples of org.apache.axis2.util.ExternalPolicySerializer


                }
            }

            // set the message payload to the message context
            InputStream in;
            ManagedDataSource dataSource;
            if (builder instanceof DataSourceMessageBuilder && entry.isStreaming()) {
                in = null;
                dataSource = ManagedDataSourceFactory.create(
                        new FileObjectDataSource(file, contentType));
            } else {
                in = content.getInputStream();
                dataSource = null;
            }
           
            try {
                OMElement documentElement;
                if (in != null) {
                    documentElement = builder.processDocument(in, contentType, msgContext);
                } else {
                    documentElement = ((DataSourceMessageBuilder)builder).processDocument(
                            dataSource, contentType, msgContext);
                }
                msgContext.setEnvelope(TransportUtils.createSOAPEnvelope(documentElement));
               
                handleIncomingMessage(
                    msgContext,
                    transportHeaders,
                    null, //* SOAP Action - not applicable *//
                    contentType
                );
            }
            finally {
                if (in != null) {
                    try {
                        in.close();
                    } catch (IOException ex) {
                        handleException("Error closing stream", ex);
                    }
                } else {
                    dataSource.destroy();
                }
            }

            if (log.isDebugEnabled()) {
                log.debug("Processed file : " + file + " of Content-type : " + contentType);
View Full Code Here


            String charSetEncoding = BuilderUtil.getCharSetEncoding(contentTypeStr);
            msgContext.setProperty(
                    Constants.Configuration.CHARACTER_SET_ENCODING, charSetEncoding);
            boolean eprFound = false;
            if (endpointsConfiguration != null) {
                URLEndpoint epr = endpointsConfiguration.getEndpoint(request.getRequestLine().getUri());
                if (epr != null) {
                    eprFound = true;
                    String type = TransportUtils.getContentType(contentTypeStr, msgContext);
                    msgContext.setProperty(Constants.Configuration.MESSAGE_TYPE, type);
                    epr.setParameters(msgContext);

                    Builder builder = epr.getBuilder(type);
                    if (HTTPTransportUtils.isRESTRequest(contentTypeStr)) {
                        RESTUtil.processPOSTRequest(msgContext, is, os,
                                request.getRequestLine().getUri(), contentType, builder, isRestDispatching);
                    } else {
View Full Code Here

            String contentTypeStr = contentType != null ?
                    contentType.getValue() : inferContentType();

            boolean eprFound = false;
            if (endpointsConfiguration != null) {
                URLEndpoint epr = endpointsConfiguration.getEndpoint(request.getRequestLine().getUri());
                if (epr != null) {
                    eprFound = true;
                    String type = TransportUtils.getContentType(contentTypeStr, msgContext);
                    msgContext.setProperty(Constants.Configuration.MESSAGE_TYPE, type);

                    epr.setParameters(msgContext);

                    Builder builder = epr.getBuilder(type);
                    RESTUtil.processGetAndDeleteRequest(
                            msgContext, os, request.getRequestLine().getUri(),
                            request.getFirstHeader(HTTP.CONTENT_TYPE), builder,
                            method, isRestDispatching);
                }
View Full Code Here

        params = getListenerParameters();


        param = transportIn.getParameter(NhttpConstants.ENDPOINTS_CONFIGURATION);
        if (param != null && param.getValue() != null) {
            endpoints = new URLEndpointsConfigurationFactory().create(param.getValue().toString());
        }
    }
View Full Code Here

                    return;
                } else if (policy >= 0) {

                    OutputStream out = res.getOutputStream();

                    ExternalPolicySerializer serializer = new ExternalPolicySerializer();
                    serializer.setAssertionsToFilter(configContext
                            .getAxisConfiguration().getLocalPolicyAssertions());

                    // check whether Id is set
                    String idParam = req.getParameter("id");
View Full Code Here

                        res.sendError(HttpServletResponse.SC_NOT_FOUND);
                    }
                    return;
                } else if (policy >= 0) {

                    ExternalPolicySerializer serializer = new ExternalPolicySerializer();
                    serializer.setAssertionsToFilter(configContext
                            .getAxisConfiguration().getLocalPolicyAssertions());

                    // check whether Id is set
                    String idParam = req.getParameter("id");
View Full Code Here

                    return;
                }

                PolicyRegistry reg = policyInclude.getPolicyRegistry();

                ExternalPolicySerializer serializer = new ExternalPolicySerializer();
                if (configCtx.getAxisConfiguration()
                        .getLocalPolicyAssertions() != null) {
                    serializer.setAssertionsToFilter(
                            configCtx.getAxisConfiguration().getLocalPolicyAssertions());
                }


                if (policyElements.size() == 1) {
                    response.addHeader(HTTP.CONTENT_TYPE, "text/xml");
                    if (policyElements.get(0) instanceof Policy) {
                        Policy policy = (Policy) policyElements.get(0);
                        serializer.serialize(policy, outputStream);
                    } else if (policyElements.get(0) instanceof PolicyReference) {
                        String key = ((PolicyReference) policyElements.get(0)).getURI();
                        if (key.startsWith("#")) {
                            key = key.substring(key.indexOf("#") + 1);
                        }

                        Policy p = reg.lookup(key);
                        if (p == null) {
                            response.addHeader(HTTP.CONTENT_TYPE, "text/html");
                            outputStream.write("<h4>Policy element not found!</h4>".getBytes());
                        } else {
                            serializer.serialize(p, outputStream);
                        }
                    }
                } else {
                    // for many policies
                    String idParam = request.getParameter("id");
                    if (idParam != null) {
                        Object policyObject = policyElements.get(Integer.parseInt(idParam));
                        if (policyObject != null) {
                            response.addHeader(HTTP.CONTENT_TYPE, "text/xml");
                            if (policyObject instanceof Policy) {
                                Policy policy = (Policy) policyObject;
                                serializer.serialize(policy, outputStream);
                            } else if (policyObject instanceof PolicyReference) {
                                String key = ((PolicyReference) policyObject).getURI();
                                if (key.startsWith("#")) {
                                    key = key.substring(key.indexOf("#") + 1);
                                }
                                Policy p = reg.lookup(key);
                                if (p == null) {
                                    response.addHeader(HTTP.CONTENT_TYPE, "text/html");
                                    outputStream
                                            .write("<h4>Policy element not found!</h4>".getBytes());
                                } else {
                                    serializer.serialize(p, outputStream);
                                }
                            }
                        } else {
                            response.addHeader(HTTP.CONTENT_TYPE, "text/html");
                            outputStream.write("<h4>Policy not found!</h4>".getBytes());
View Full Code Here

        Map nameSpacesMap = axisService.getNamespaceMap();
        OMFactory omFactory = OMAbstractFactory.getOMFactory();
        OMNamespace wsdl;
       
        //
        filter = new ExternalPolicySerializer();
    AxisConfiguration axisConfiguration = axisService
        .getAxisConfiguration();
    if (axisConfiguration != null) {
      filter.setAssertionsToFilter(axisConfiguration
          .getLocalPolicyAssertions());
View Full Code Here

                        res.sendError(HttpServletResponse.SC_NOT_FOUND);
                    }
                    return;
                } else if (policy >= 0) {

                    ExternalPolicySerializer serializer = new ExternalPolicySerializer();
                    serializer.setAssertionsToFilter(configContext
                            .getAxisConfiguration().getLocalPolicyAssertions());

                    // check whether Id is set
                    String idParam = req.getParameter("id");
View Full Code Here

      }
    }

    this.targetNamespace = axisService.getTargetNamespace();

    serializer = new ExternalPolicySerializer();
    // CHECKME check whether service.getAxisConfiguration() return null ???

    AxisConfiguration configuration = axisService.getAxisConfiguration();
    if (configuration != null) {
      serializer.setAssertionsToFilter(configuration
View Full Code Here

TOP

Related Classes of org.apache.axis2.util.ExternalPolicySerializer

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.