Examples of AxisService


Examples of org.apache.axis2.description.AxisService

        }
        return null;
    }

    private AxisService createAxisService() throws AxisFault {
        AxisService axisService;
        if (wsBinding.getWSDLDefinition() != null) {
            axisService = createWSDLAxisService();
        } else {
            axisService = createJavaAxisService();
        }
View Full Code Here

Examples of org.apache.axis2.description.AxisService

    /**
     * Create an AxisService from the interface class from the SCA service interface
     */
    protected AxisService createJavaAxisService() throws AxisFault {
        AxisService axisService = new AxisService();
        String path = URI.create(wsBinding.getURI()).getPath();
        axisService.setName(path);
        axisService.setServiceDescription("Tuscany configured AxisService for service: " + wsBinding.getURI());
        axisService.setClientSide(false);
        Parameter classParam =
            new Parameter(Constants.SERVICE_CLASS, ((JavaInterface)contract.getInterfaceContract().getInterface())
                .getJavaClass().getName());
        axisService.addParameter(classParam);
        try {
            Utils.fillAxisService(axisService, configContext.getAxisConfiguration(), null, null);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
View Full Code Here

Examples of org.apache.axis2.description.AxisService

        builder.setServerSide(true);
        // [rfeng] Add a custom resolver to work around WSCOMMONS-228
        builder.setCustomResolver(new URIResolverImpl(definition));
        builder.setBaseUri(definition.getDocumentBaseURI());
        // [rfeng]
        AxisService axisService = builder.populateService();

        String path = URI.create(wsBinding.getURI()).getPath();
        String name = ( path.startsWith( "/") ? path.substring(1) : path );
        axisService.setName(name);
        String endpointURL = wsBinding.getURI();
        axisService.setEndpointURL(endpointURL );
        axisService.setDocumentation("Tuscany configured AxisService for service: " + wsBinding.getURI());
        for ( Iterator i = axisService.getEndpoints().values().iterator(); i.hasNext(); ) {
            AxisEndpoint ae = (AxisEndpoint)i.next();
            if (endpointURL.startsWith("jms") ) {
                Parameter qcf = new Parameter(JMSConstants.CONFAC_PARAM, null);
                qcf.setValue(DEFAULT_QUEUE_CONNECTION_FACTORY);
                axisService.addParameter(qcf);
                break;
            }
        }
        // Use the existing WSDL
        Parameter wsdlParam = new Parameter(WSDLConstants.WSDL_4_J_DEFINITION, null);
        wsdlParam.setValue(definition);
        axisService.addParameter(wsdlParam);
        Parameter userWSDL = new Parameter("useOriginalwsdl", "true");
        axisService.addParameter(userWSDL);

        return axisService;
    }
View Full Code Here

Examples of org.apache.axis2.description.AxisService

                }
                JavaTypeMapper typeMapper = new JavaTypeMapper();
                for (Map.Entry<QName, SDODataBindingTypeMappingEntry> e : typeMapping.entrySet()) {
                    typeMapper.addTypeMappingObject(e.getKey(), e.getValue());
                }
                AxisService axisService;
                try {
                    axisService = new WSDL2AxisServiceBuilder(definition, serviceQname, port.getName()).populateService();
                } catch (AxisFault e) {
                    throw new CodeGenerationException(e);
                }
                axisService.setName(port.getBinding().getPortType().getQName().getLocalPart());
                CodeGenConfiguration codegenConfiguration = new CodeGenConfiguration(Collections.EMPTY_MAP);
                codegenConfigurations.add(codegenConfiguration);
                codegenConfiguration.setAxisService(axisService);
                codegenConfiguration.setAdvancedCodeGenEnabled(false);
                codegenConfiguration.setAsyncOn(false);
View Full Code Here

Examples of org.apache.axis2.description.AxisService

        initServlet(epc);
        return epc;
    }

    private void initServlet(EntryPointContext epc) {
        AxisService axisService;
        try {
            axisService = createAxisService(epc, wsBinding);
        } catch (AxisFault e) {
            throw new BuilderConfigException(e);
        }
View Full Code Here

Examples of org.apache.axis2.description.AxisService

        // serviceGroup.setServiceGroupName(wsdlPortInfo.getServiceName().getLocalPart());
        // axisConfig.addServiceGroup(serviceGroup);

        WSDL2AxisServiceBuilder builder = new WSDL2AxisServiceBuilder(definition, wsdlPortInfo.getServiceName(), wsdlPortInfo.getPort().getName());
        builder.setServerSide(true);
        AxisService axisService = builder.populateService();

        axisService.setName(entryPointName);
        // axisService.setParent(serviceGroup);
        axisService.setServiceDescription("Tuscany configured AxisService for EntryPoint: '" + entryPointName + '\'');

        TypeHelper typeHelper = wsBinding.getTypeHelper();
        ClassLoader cl = wsBinding.getResourceLoader().getClassLoader();

        Class<?> serviceInterface = entryPointContext.getServiceInterface();

        PortType wsdlPortType = wsdlPortInfo.getPortType();
        for (Object o : wsdlPortType.getOperations()) {
            Operation wsdlOperation = (Operation) o;
            String operationName = wsdlOperation.getName();
            QName operationQN = new QName(definition.getTargetNamespace(), operationName);
            Object entryPointProxy = entryPointContext.getInstance(null);

            WebServiceOperationMetaData omd = wsdlPortInfo.getOperationMetaData(operationName);
            QName responseTypeQN = omd.getOutputPart(0).getElementName();

            Method operationMethod = getMethod(serviceInterface, operationName);
            SDODataBinding dataBinding = new SDODataBinding(cl, typeHelper, responseTypeQN, omd.isDocLitWrapped());
            WebServiceEntryPointInOutSyncMessageReceiver msgrec = new WebServiceEntryPointInOutSyncMessageReceiver(entryPointProxy, operationMethod,
                    dataBinding, cl);

            AxisOperation axisOp = axisService.getOperation(operationQN);
            axisOp.setMessageExchangePattern(WSDLConstants.MEP_URI_IN_OUT);
            axisOp.setMessageReceiver(msgrec);
        }

        return axisService;
View Full Code Here

Examples of org.apache.axis2.description.AxisService

        String portName = wsPortMetaData.getPortName().getLocalPart();

        ServiceClient serviceClient;
        try {

            AxisService axisService = AxisService.createClientSideAxisService(wsdlDefinition, serviceQName, portName, new Options());
            serviceClient = new ServiceClient(configurationContext, axisService);

        } catch (AxisFault e) {
            BuilderConfigException bce = new BuilderConfigException("AxisFault creating external service", e);
            bce.addContextName(externalServiceName);
View Full Code Here

Examples of org.apache.axis2.description.AxisService

        QName serviceQName = portInfo.getWsdlService() == null ? wsdlService.getQName() : portInfo.getWsdlService();

        WSDLToAxisServiceBuilder wsdlBuilder = new WSDL11ToAxisServiceBuilder(wsdlDefinition, serviceQName , portName);

        //populate with axis2 objects
        AxisService service = wsdlBuilder.populateService();
        service.addParameter(new Parameter(Constants.SERVICE_CLASS, endpointClassName));
        service.setWsdlFound(true);
        service.setClassLoader(classLoader);

        Class endPointClass = classLoader.loadClass(endpointClassName);
        JavaClassToDBCConverter converter = new JavaClassToDBCConverter(endPointClass);
        HashMap<String, DescriptionBuilderComposite> dbcMap = converter.produceDBC();

        DescriptionBuilderComposite dbc = dbcMap.get(endpointClassName);
        dbc.setClassLoader(classLoader);
        dbc.setWsdlDefinition(wsdlDefinition);
        dbc.setClassName(endpointClassName);
        dbc.setCustomWsdlGenerator(new WSDLGeneratorImpl(wsdlDefinition));
        if (dbc.getWebServiceAnnot() != null) { //information specified in .wsdl should overwrite annotation.
            WebServiceAnnot serviceAnnot = dbc.getWebServiceAnnot();
            serviceAnnot.setPortName(portName);
            serviceAnnot.setServiceName(service.getName());
            serviceAnnot.setTargetNamespace(service.getTargetNamespace());
        } else if (dbc.getWebServiceProviderAnnot() != null) {
            //TODO: can webservice and webservice provider annot co-exist?
            WebServiceProviderAnnot serviceProviderAnnot = dbc.getWebServiceProviderAnnot();
            serviceProviderAnnot.setPortName(portName);
            serviceProviderAnnot.setServiceName(service.getName());
            serviceProviderAnnot.setTargetNamespace(service.getTargetNamespace());
        }

        for(Iterator<AxisOperation> opIterator = service.getOperations() ; opIterator.hasNext() ;){
            AxisOperation operation = opIterator.next();
            operation.setMessageReceiver(JAXWSMessageReceiver.class.newInstance());
            String MEP = operation.getMessageExchangePattern();
            if (!WSDLUtil.isOutputPresentForMEP(MEP)) {
                List<MethodDescriptionComposite> mdcList = dbc.getMethodDescriptionComposite(operation.getName().toString());
                for(Iterator<MethodDescriptionComposite> mIterator = mdcList.iterator(); mIterator.hasNext();){
                    MethodDescriptionComposite mdc = mIterator.next();
                    //TODO: JAXWS spec says need to check Holder param exist before taking a method as OneWay
                    mdc.setOneWayAnnot(true);
                }
            }
        }

        List<ServiceDescription> serviceDescList = DescriptionFactory.createServiceDescriptionFromDBCMap(dbcMap);
        ServiceDescription sd = serviceDescList.get(0);
        Parameter serviceDescription = new Parameter(EndpointDescription.AXIS_SERVICE_PARAMETER, sd.getEndpointDescriptions()[0]);
        service.addParameter(serviceDescription);

        return service;
    }
View Full Code Here

Examples of org.apache.axis2.description.AxisService

            final MessageContext msgContext) throws Exception {

        ConfigurationContext configurationContext = msgContext.getConfigurationContext();
        String soapAction = request.getHeader(HTTPConstants.HEADER_SOAP_ACTION);
       
        AxisService service = findServiceWithEndPointClassName(configurationContext, endpointClassName);

        // TODO: Port this section
//        // Adjust version and content chunking based on the config
//        boolean chunked = false;
//        TransportOutDescription transportOut = msgContext.getTransportOut();
View Full Code Here

Examples of org.apache.axis2.description.AxisService

            // Visit all the AxisServices
            AxisServiceGroup svcGrp = (AxisServiceGroup) svcGrpIter.next();
            Iterator svcIter = svcGrp.getServices();
            while (svcIter.hasNext()) {
                AxisService service = (AxisService) svcIter.next();

                // Grab the Parameter that stores the ServiceClass.
                String epc = (String)service.getParameter("ServiceClass").getValue();
               
                if (epc != null) {
                    // If we have a match, then just return the AxisService now.
                    if (endPointClassName.equals(epc)) {
                        return service;
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.