public static synchronized void deployService(AxisService service) throws AxisFault { receiver.getConfigurationContext().getAxisConfiguration().addService( service); }
public static void deployService(String serviceName, String scope, InputStream config) throws Exception { if (context == null) { throw new RuntimeException("Missing context"); } // Load the service AxisService service = DeploymentEngine.buildService(config, Thread.currentThread().getContextClassLoader(), context); // Service name = actor name service.setName(serviceName); // application scope service.setScope(scope); // Register the service context.getAxisConfiguration().addService(service); // FIXME: it seems that it takes a bit longer for a service to become available }
public void creatService(String serviceName) throws AxisFault { AxisService service = AxisService.createService(serviceName, getAxisConfig()); getAxisConfig().addService(service); }
/** * Deploy a service to the embedded AxisConfiguration, and initialize it. * * @param service service to deploy * @throws AxisFault if there's a problem */ public void deployService(AxisService service) throws AxisFault { axisConfiguration.addService(service); if (Constants.SCOPE_APPLICATION.equals(service.getScope())) { ServiceGroupContext sgc = createServiceGroupContext(service.getAxisServiceGroup()); DependencyManager.initService(sgc); } }
/** * Deploy a service to the embedded AxisConfiguration, and initialize it. * * @param service service to deploy * @throws AxisFault if there's a problem */ public void deployService(AxisService service) throws AxisFault { axisConfiguration.addService(service); if (Constants.SCOPE_APPLICATION.equals(service.getScope())) { ServiceGroupContext sgc = createServiceGroupContext(service.getAxisServiceGroup()); DependencyManager.initService(sgc); } }
/** * Will make Java class into a web service * * @param serviceClassName : Actual class you want to make as a web service * @throws AxisFault : If something went wrong */ public void deployService(String serviceClassName) throws AxisFault { if (configContext == null) { configContext = getConfigurationContext(); } AxisConfiguration axisConfig = configContext.getAxisConfiguration(); AxisService service = AxisService.createService(serviceClassName, axisConfig); axisConfig.addService(service); if (startOnDeploy) { start(); } }
/** * @param args * @throws AxisFault * @throws Exception */ public void start() throws AxisFault { ConfigurationContext context = ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null); context.setProperty(ADDRESSING_VALIDATE_ACTION, Boolean.valueOf(false)); context.getAxisConfiguration().addParameter(SUPPORT_SINGLE_OP, Boolean.valueOf(true)); context.getAxisConfiguration().addParameter(ADDRESSING_VALIDATE_ACTION, Boolean.valueOf(false)); Map<String, MessageReceiver> msgRecieverMap = new HashMap<String, MessageReceiver>(); ConsumerMsgReceiver conMsgRcv = new ConsumerMsgReceiver(handler); msgRecieverMap.put("http://www.w3.org/ns/wsdl/in-only", conMsgRcv); AxisService service = AxisService.createService(ConsumerService.class.getName(), context.getAxisConfiguration(), msgRecieverMap, null, null, ConsumerServer.class.getClassLoader()); context.getAxisConfiguration().addService(service); server = new SimpleHTTPServer(context, this.listeningPort); server.start(); consumerService = service; }
/** * @param args * @throws AxisFault * @throws Exception */ public void start() throws AxisFault { ConfigurationContext context = ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null); context.setProperty(ADDRESSING_VALIDATE_ACTION, Boolean.valueOf(false)); context.getAxisConfiguration().addParameter(SUPPORT_SINGLE_OP, Boolean.valueOf(true)); context.getAxisConfiguration().addParameter(ADDRESSING_VALIDATE_ACTION, Boolean.valueOf(false)); Map<String, MessageReceiver> msgRecieverMap = new HashMap<String, MessageReceiver>(); ConsumerMsgReceiver conMsgRcv = new ConsumerMsgReceiver(handler); msgRecieverMap.put("http://www.w3.org/ns/wsdl/in-only", conMsgRcv); AxisService service = AxisService.createService(ConsumerService.class.getName(), context.getAxisConfiguration(), msgRecieverMap, null, null, ConsumerServer.class.getClassLoader()); context.getAxisConfiguration().addService(service); server = new SimpleHTTPServer(context, this.listeningPort); server.start(); consumerService = service; }
public void buildService(AxisConfiguration axisCfg) throws AxisFault { AxisService eventSourceService = new AxisService(); eventSourceService.setName(this.name); // Add wse operations addOperations(eventSourceService); axisCfg.addService(eventSourceService); //Set the service parameters eventSourceService .addParameter(EventingConstants.SUBSCRIPTION_MANAGER, subscriptionManager); eventSourceService.addParameter(SynapseEventingConstants.SERVICE_TYPE, SynapseEventingConstants.EVENTING_ST); }
@Override protected void before() throws Throwable { super.before(); ConfigurationContext configurationContext = getConfigurationContext(); AxisConfiguration axisConfiguration = configurationContext.getAxisConfiguration(); for (AxisServiceFactory serviceFactory : serviceFactories) { axisConfiguration.addService(serviceFactory.createService(axisConfiguration)); } startServer(configurationContext); }
public void buildService(AxisConfiguration axisCfg) throws AxisFault { AxisService eventSourceService = new AxisService(); eventSourceService.setName(this.name); // Add wse operations addOperations(eventSourceService); axisCfg.addService(eventSourceService); //Set the service parameters eventSourceService .addParameter(EventingConstants.SUBSCRIPTION_MANAGER, subscriptionManager); eventSourceService.addParameter(SynapseEventingConstants.SERVICE_TYPE, SynapseEventingConstants.EVENTING_ST); }
/** * Will make Java class into a web service * * @param serviceClassName : Actual class you want to make as a web service * @throws AxisFault : If something went wrong */ public void deployService(String serviceClassName) throws AxisFault { if (configContext == null) { configContext = getConfigurationContext(); } AxisConfiguration axisConfig = configContext.getAxisConfiguration(); AxisService service = AxisService.createService(serviceClassName, axisConfig); axisConfig.addService(service); if (startOnDeploy) { start(); } }
private void createAxisService(String endpointURL, Port port) throws AxisFault { AxisService axisService; if (wsBinding.getGeneratedWSDLDocument() != null) { axisService = Axis2EngineIntegration.createWSDLAxisService(endpointURL, port, wsBinding); } else { axisService = Axis2EngineIntegration.createJavaAxisService(endpointURL, configContext, service); } Axis2EngineIntegration.createAxisServiceProviders(axisService, endpoint, wsBinding, extensionPoints); configContext.getAxisConfiguration().addService(axisService); } }
public void start()throws AxisFault { try { //Register the callback service AxisService messageCollectorService = new AxisService("MessageCollector"); MessageReceiver messageReceiver = new MessageReceiver() { public void receive(MessageContext messageCtx) throws AxisFault { if(callback != null){ callback.mesageReceived(messageCtx.getEnvelope()); }else{ System.out.println("Received " + messageCtx.getEnvelope()); } } }; InOutAxisOperation operation1 = new InOutAxisOperation(new QName("receive")); operation1.setMessageReceiver(messageReceiver); messageCollectorService.addOperation(operation1); configContext.getAxisConfiguration().addService(messageCollectorService); axis2Server = new SimpleHTTPServer(configContext, 7777); axis2Server.start(); eventSinkUrl = axis2Server.getEPRForService(messageCollectorService.getName(), InetAddress.getLocalHost().getHostName()); } catch (UnknownHostException e) { throw AxisFault.makeFault(e); } }
/** * Configure the ServiceClient to interact with the Web service described by the specified * AxisService object. * * @param axisService the AxisService that represents the new Web service. * @throws AxisFault if an error occurs while configuring the ServiceClient. */ public void setAxisService(AxisService axisService) throws AxisFault { if (axisService == null) { // AxisFault? throw new IllegalArgumentException("AxisService is null"); } synchronized (this.axisConfig) { axisConfig.removeService(this.axisService.getName()); this.axisService = axisService; axisService.setClientSide(true); axisConfig.addService(axisService); } AxisServiceGroup axisServiceGroup = axisService.getAxisServiceGroup(); ServiceGroupContext serviceGroupContext = configContext.createServiceGroupContext(axisServiceGroup); this.serviceContext = serviceGroupContext.getServiceContext(axisService); }
/** * Configure the ServiceClient to interact with the Web service described by the specified * AxisService object. * * @param axisService the AxisService that represents the new Web service. * @throws AxisFault if an error occurs while configuring the ServiceClient. */ public void setAxisService(AxisService axisService) throws AxisFault { if (axisService == null) { // AxisFault? throw new IllegalArgumentException("AxisService is null"); } synchronized (this.axisConfig) { axisConfig.removeService(this.axisService.getName()); this.axisService = axisService; axisService.setClientSide(true); axisConfig.addService(axisService); } AxisServiceGroup axisServiceGroup = axisService.getAxisServiceGroup(); ServiceGroupContext serviceGroupContext = configContext.createServiceGroupContext(axisServiceGroup); this.serviceContext = serviceGroupContext.getServiceContext(axisService); }
private static AxisService createAnonymousService(AxisConfiguration axisCfg, String serviceKey) { try { OutOnlyAxisOperation outOnlyOperation = new OutOnlyAxisOperation(ServiceClient.ANON_OUT_ONLY_OP); OutInAxisOperation outInOperation = new OutInAxisOperation(ServiceClient.ANON_OUT_IN_OP); AxisService axisAnonymousService = new AxisService(serviceKey); axisAnonymousService.addOperation(outOnlyOperation); axisAnonymousService.addOperation(outInOperation); // set a right default action *after* operations have been added to the service. outOnlyOperation.setSoapAction(""); outInOperation.setSoapAction(""); if (log.isDebugEnabled()) { log.debug("Creating Client Service: " + serviceKey); } axisAnonymousService.setClientSide(true); axisCfg.addService(axisAnonymousService); return axisAnonymousService; } catch (AxisFault axisFault) { handleException("Adding service to axis configuration failed.", axisFault); } return null; } }
cfgCtx.getAxisConfiguration().addService(service);
@Override protected void setUp() throws Exception { service = new AxisService(); outputStream = new ByteArrayOutputStream(); schemas = new ArrayList<XmlSchema>(); loadSampleSchemaFile(schemas); service.addSchema(schemas); AxisConfiguration axisConfiguration = new AxisConfiguration(); service.setName("test_service"); axisConfiguration.addChild(service); axisConfiguration.addService(service); configurationContext = new ConfigurationContext(axisConfiguration); configurationContext.setServicePath("test_service"); configurationContext.setContextRoot("test/context"); messageContext.setConfigurationContext(configurationContext); }
public void provision(Axis2WireSourceDefinition pwsd, Wire wire) throws WiringException { try { String uri = expandUri(pwsd.getUri()); URI classLoaderUri = pwsd.getClassLoaderId(); String serviceClass = pwsd.getServiceInterface(); ClassLoader classLoader = classLoaderRegistry.getClassLoader(classLoaderUri); AxisService axisService = new AxisService(); axisService.setName(uri); axisService.setDocumentation("Fabric3 enabled axis service"); axisService.setClientSide(false); axisService.setClassLoader(classLoader); axisService.setEndpointURL(uri); Parameter interfaceParameter = new Parameter(Constants.SERVICE_CLASS, serviceClass); axisService.addParameter(interfaceParameter); setMessageReceivers(wire, axisService); // Reset the name axisService.setName(uri); configurationContext.getAxisConfiguration().addService(axisService); applyPolicies(pwsd, axisService); axisServlet.registerClassLoader("/" + servicePath + "/" + uri, classLoader); monitor.endpointProvisioned("/" + servicePath + "/" + uri); } catch (Exception e) { throw new WiringException(e); } }