Package org.apache.axis2.description

Examples of org.apache.axis2.description.ServiceDescription


    }


    public void testEchoXMLCompleteASync() throws Exception {
        ServiceDescription service =
            Utils.createSimpleService(
                serviceName,
        Echo.class.getName(),
                operationName);
View Full Code Here


            sysContext = ListenerManager.configurationContext;
        }

        //create new service
        QName assumedServiceName = new QName("AnonnoymousService");
        ServiceDescription axisService = new ServiceDescription(assumedServiceName);
        sysContext.getAxisConfiguration().addService(axisService);
        ServiceContext service = sysContext.createServiceContext(assumedServiceName);
        return service;
    }
View Full Code Here

//        }
//        return service;
//    }

    public ServiceDescription createService(ArchiveFileData file) throws DeploymentException {
        ServiceDescription service = null;
        InputStream in= file.getClassLoader().getResourceAsStream(SERVICEWSDL);
        boolean foundservice = false;
        try {
            if(in!= null){
                WOMBuilder builder = WOMBuilderFactory.getBuilder(WOMBuilderFactory.WSDL11);
                WSDLVersionWrapper wsdlVersionWrapper = builder.build(in, new AxisDescWSDLComponentFactory());
                WSDLDescription  womDescription = wsdlVersionWrapper.getDescription();
                Iterator iterator = womDescription.getServices().keySet().iterator();
                if(iterator.hasNext()){
                    foundservice = true;
                    service = (ServiceDescription)womDescription.getServices().get(iterator.next());
                }
                if(!foundservice){
                    service = new ServiceDescription();
                }
                service.setWSDLDefinition(wsdlVersionWrapper.getDefinition());
                in.close();
            } else {
                service = new ServiceDescription();
                log.info("WSDL file not found for the service :  " + file.getName());
            }
        } catch (Exception e) {
            throw new DeploymentException(e);
        }
View Full Code Here

        cl = Thread.currentThread().getContextClassLoader();
    }

    protected void setUp() throws Exception {
        UtilServer.start();
        ServiceDescription service = Utils.createSimpleService(serviceName,Echo.class.getName(),operationName);
       
       
        service.setInFlow(new MockFlow("service inflow", 4));
        service.setOutFlow(new MockFlow("service outflow", 5));
        //service.setFaultInFlow(new MockFlow("service faultflow", 1));

        ModuleDescription m1 = new ModuleDescription(new QName("", "A Mdoule 1"));
        m1.setInFlow(new MockFlow("service module inflow", 4));
        //m1.setFaultInFlow(new MockFlow("service module faultflow", 1));
        service.engageModule(m1);

        OperationDescription operation = new OperationDescription(operationName);
        service.addOperation(operation);

        UtilServer.deployService(service);
        UtilServer.start();
    }
View Full Code Here

        String filename = "./target/test-resources/deployment";
        ConfigurationContextFactory builder = new ConfigurationContextFactory();
        AxisConfiguration er = builder.buildConfigurationContext(filename).getAxisConfiguration();

        assertNotNull(er);
        ServiceDescription service = er.getService(new QName("service2"));
        assertNotNull(service);
        //commentd since there is no service based messgeRecivers
        /*MessageReceiver provider = service.getMessageReceiver();
        assertNotNull(provider);
        assertTrue(provider instanceof RawXMLINOutMessageReceiver);*/
        ClassLoader cl = service.getClassLoader();
        assertNotNull(cl);
        Class.forName("Echo2", true, cl);
        assertNotNull(service.getName());
       //no style for the service
     //   assertEquals(service.getStyle(),"rpc");

        Flow flow = service.getFaultInFlow();
        assertTrue(flow.getHandlerCount() > 0);
        flow = service.getInFlow();
        assertTrue(flow.getHandlerCount() > 0);
        flow = service.getOutFlow();
        assertTrue( flow.getHandlerCount() > 0);
        assertNotNull(service.getParameter("para2"));

        OperationDescription op = service.getOperation(new QName("opname"));
        assertNotNull(op);

    }
View Full Code Here

    protected void setUp() throws Exception {
        ConfigurationContext configContext = new ConfigurationContext(new AxisConfigurationImpl());
        LocalTransportReceiver.CONFIG_CONTEXT = configContext;

        ServiceDescription service = new ServiceDescription(serviceName);
        service.addParameter(new ParameterImpl(AbstractMessageReceiver.SERVICE_CLASS, MessageContextEnabledEcho.class.getName()));
        OperationDescription operation = new OperationDescription(operationName);
        operation.setMessageReciever(new RawXMLINOnlyMessageReceiver());
        service.addOperation(operation);
        service.setClassLoader(Thread.currentThread().getContextClassLoader());
        LocalTransportReceiver.CONFIG_CONTEXT.getAxisConfiguration().addService(service);
        Utils.resolvePhases(LocalTransportReceiver.CONFIG_CONTEXT.getAxisConfiguration(), service);
    }
View Full Code Here

        super(testName);
    }

    public void testMesssageContext() throws AxisFault, SOAPProcessingException {
        AxisConfiguration er = new AxisConfigurationImpl();
        ServiceDescription servicesDesc = new ServiceDescription();
        er.addService(servicesDesc);

        ConfigurationContext engineContext = new ConfigurationContext(er);

        MessageContext msgctx = new MessageContext(engineContext);
View Full Code Here

    /* (non-Javadoc)
     * @see org.apache.axis2.engine.AbstractDispatcher#findService(org.apache.axis2.context.MessageContext)
     */
    public ServiceDescription findService(MessageContext messageContext) throws AxisFault {
        EndpointReference toEPR = messageContext.getTo();
        ServiceDescription service = null;
        if (toEPR != null) {
            QName serviceName = new QName(toEPR.getAddress());
            service =
                messageContext.getSystemContext().getAxisConfiguration().getService(serviceName);
        }
View Full Code Here

        transport.setSender(new HTTPTransportSender());

        TransportInDescription transportIn = new TransportInDescription(new QName("null"));
        axisOp = new OperationDescription(opearationName);

        service = new ServiceDescription(serviceName);
        axisOp.setMessageReciever(new MessageReceiver() {
            public void recieve(MessageContext messgeCtx) throws AxisFault {
                // TODO Auto-generated method stub

            }
View Full Code Here

        super(arg0);
    }
   
    public void testMEPfindingOnRelatesTO() throws Exception{
      
      ServiceContext sessionContext = new ServiceContext(new ServiceDescription(),new ConfigurationContext(null));
    MessageContext messageContext1 = this.getBasicMessageContext();
     
      messageContext1.setMessageID(new Long(System.currentTimeMillis()).toString());
      OperationDescription axisOperation = new OperationDescription(new QName("test"));
      OperationContext operationContext1 = axisOperation.findOperationContext(messageContext1, sessionContext);
View Full Code Here

TOP

Related Classes of org.apache.axis2.description.ServiceDescription

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.