Package org.apache.axis.deployment.wsdd

Examples of org.apache.axis.deployment.wsdd.WSDDService


         String filter = path.substring(osgiSRindex + 8);
         String serviceName = "OSGi-SR:" + filter;
         WSDDEngineConfiguration config = (WSDDEngineConfiguration) msgContext.getAxisEngine()
          .getConfig();
         WSDDDeployment deployment = config.getDeployment();
         WSDDService ws = findService(deployment, serviceName);
         SOAPService service = null;

         if (ws == null) {
            BundleContext bContext = org.knopflerfish.bundle.axis.Activator.axisBundle;
            Object serviceObject = null;
            String sfilter = "(" + filter + ")";
            ServiceReference[] srs = bContext.getServiceReferences(null,
                                                                   sfilter);

            serviceObject = bContext.getService(srs[0]);
            String addDoc = deploymentWSDD(serviceWSDD(serviceName,
                                                       serviceObject.getClass().getName()));
            WSDDDocument doc = new WSDDDocument(XMLUtils.newDocument(new ByteArrayInputStream(addDoc.getBytes())));

            doc.deploy(deployment);
            msgContext.getAxisEngine().refreshGlobalOptions();
            deployment = config.getDeployment();
            ws = findService(deployment, serviceName);
            service = deployment.getService(ws.getQName());
//            service.setOption("scope", Scope.APPLICATION_STR);
            msgContext.getAxisEngine().getApplicationSession().set(serviceName,
                                                                   serviceObject);
         }
         service = deployment.getService(ws.getQName());
         msgContext.setService(service);
      } catch (Exception e) {
         e.printStackTrace();
         throw AxisFault.makeFault(e);
      }
View Full Code Here


   private WSDDService findService(WSDDDeployment deployment, String name) {
      WSDDService[] ws = deployment.getServices();

      for (int i = 0; i < ws.length; i++) {
         WSDDService s = ws[i];

         if (ws[i].getServiceDesc().getName().equals(name))
            return ws[i];
      }
      return null;
View Full Code Here

     */
    public Iterator getDeployedServices() throws ConfigurationException {
        ArrayList serviceDescs = new ArrayList();
        WSDDService [] services = this.deployment.getServices();
        for (int i = 0; i < services.length; i++) {
            WSDDService service = services[i];
            serviceDescs.add(service.getServiceDesc());
        }
        return serviceDescs.iterator();
    }
View Full Code Here

     */
    public Iterator getDeployedServices() throws ConfigurationException {
        ArrayList serviceDescs = new ArrayList();
        WSDDService [] services = this.deployment.getServices();
        for (int i = 0; i < services.length; i++) {
            WSDDService service = services[i];
            serviceDescs.add(service.getServiceDesc());
        }
        return serviceDescs.iterator();
    }
View Full Code Here

     */
    public void testThrowingSOAPFaultExceptionFromServiceMethod() throws Exception {

        WSDDDeployment conf = new WSDDDeployment();

        WSDDService service = new WSDDService();
        service.setName(SERVICE_NAME);
        service.setProviderQName(new QName(WSDDConstants.URI_WSDD_JAVA, "RPC"));
        service.setParameter("className", this.getClass().getName());
        service.setParameter("allowedMethods", "doSth");
        service.deployToRegistry(conf);

        AxisServer engine = new AxisServer(conf);

        LocalTransport transport = new LocalTransport(engine);
        transport.setRemoteService(SERVICE_NAME);

        // create messageContext
        MessageContext mc = new MessageContext(engine);
        mc.setService((SOAPService) service.getInstance(conf));
        mc.setProperty(MessageContext.TRANS_URL, "local");

        // create SOAP envelope
        SOAPEnvelope env = new SOAPEnvelope();
        SOAPBody body = (SOAPBody) env.getBody();
View Full Code Here

            handler.writeToContext(context);
        }
       
        i = services.values().iterator();
        while (i.hasNext()) {
            WSDDService service = (WSDDService)i.next();
            service.writeToContext(context);
        }
       
        i = transports.values().iterator();
        while (i.hasNext()) {
            WSDDTransport transport = (WSDDTransport)i.next();
View Full Code Here

     */
    public void testThrowingSOAPFaultExceptionFromServiceMethod() throws Exception {

        WSDDDeployment conf = new WSDDDeployment();

        WSDDService service = new WSDDService();
        service.setName(SERVICE_NAME);
        service.setProviderQName(new QName(WSDDConstants.URI_WSDD_JAVA, "RPC"));
        service.setParameter("className", this.getClass().getName());
        service.setParameter("allowedMethods", "doSth");
        service.deployToRegistry(conf);

        AxisServer engine = new AxisServer(conf);

        LocalTransport transport = new LocalTransport(engine);
        transport.setRemoteService(SERVICE_NAME);

        // create messageContext
        MessageContext mc = new MessageContext(engine);
        mc.setService((SOAPService) service.getInstance(conf));
        mc.setProperty(MessageContext.TRANS_URL, "local");

        // create SOAP envelope
        SOAPEnvelope env = new SOAPEnvelope();
        SOAPBody body = (SOAPBody) env.getBody();
View Full Code Here

TOP

Related Classes of org.apache.axis.deployment.wsdd.WSDDService

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.