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 }
addDocumentation(axisService, documentationElement); axisService.setName(wsdl4jService.getQName().getLocalPart()); populateEndpoints(binding, bindingWSDL,wsdl4jService, portType); processPoliciesInDefintion(wsdl4jDefinition);
null, new BundleClassLoader(bundle, WSTracker.class.getClassLoader())); axisService.setName(wsName); configCtx.getAxisConfiguration().addService(axisService); log.info("Added new WS from ServiceReference : " + service.getClass().getName());
private void processService() throws AxisFault { Service[] services = description.getServices(); if (services.length == 0) { throw new AxisFault("No wsdlService found in the WSDL"); } if (serviceName != null) { for (int i = 0; i < services.length; i++) { if (serviceName.equals(services[i].getName())) { wsdlService = services[i]; break; // found it. Stop looking. } } if (wsdlService == null) { throw new AxisFault("Service with the specified name not found in the WSDL : " + serviceName.getLocalPart()); } } else { wsdlService = services[0]; } axisService.setName(wsdlService.getName().getLocalPart()); Interface serviceInterface = wsdlService.getInterface(); axisService.addParameter(new Parameter(WSDL2Constants.INTERFACE_LOCAL_NAME, serviceInterface.getName().getLocalPart())); processInterface(serviceInterface); if (isCodegen) { axisService.setOperationsNameList(operationNames); } processEndpoints(serviceInterface); }
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); }
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); }
private void processService() throws AxisFault { Service[] services = description.getServices(); if (services.length == 0) { throw new AxisFault("No wsdlService found in the WSDL"); } if (serviceName != null) { for (int i = 0; i < services.length; i++) { if (serviceName.equals(services[i].getName())) { wsdlService = services[i]; break; // found it. Stop looking. } } if (wsdlService == null) { throw new AxisFault("Service with the specified name not found in the WSDL : " + serviceName.getLocalPart()); } } else { wsdlService = services[0]; } axisService.setName(wsdlService.getName().getLocalPart()); Interface serviceInterface = wsdlService.getInterface(); axisService.addParameter(new Parameter(WSDL2Constants.INTERFACE_LOCAL_NAME, serviceInterface.getName().getLocalPart())); processInterface(serviceInterface); if (isCodegen) { axisService.setOperationsNameList(operationNames); } processEndpoints(serviceInterface); }
/** * Create an AxisService from the Java interface class of the SCA service interface */ public static AxisService createJavaAxisService(String endpointURL, ConfigurationContext configContext, AbstractContract contract) throws AxisFault { AxisService axisService = new AxisService(); String path = URI.create(endpointURL).getPath(); axisService.setName(path); axisService.setServiceDescription("Tuscany configured AxisService for service: " + endpointURL); 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); } return axisService; }
public synchronized ServiceClient getServiceClient() { try { if (serviceClient == null) { ConfigurationContext configCtx = getServiceDescription().getAxisConfigContext(); AxisService axisSvc = getAxisService(); AxisConfiguration axisCfg = configCtx.getAxisConfiguration(); // The method synchronization prevents more than 1 service client being created // for the same EndpointDescription instance by multiple threads. We also need // to prevent different EndpointDescription instances from creating service client // instances using the same AxisService name under multiple threads. We do that by // synchronizing on the AxisConfiguration instance. synchronized(axisCfg) { if (axisCfg.getService(axisSvc.getName()) != null) { axisSvc.setName(axisSvc.getName() + uniqueID()); if (log.isDebugEnabled()) { log.debug("AxisService name is now " + axisSvc.getName() + ". This name should be unique; if not, errors might occur."); } } serviceClient = new ServiceClient(configCtx, axisSvc); // Disable automatic cleanup to avoid threading issues in Axis2 during the cleanup. JAXWS will // drive the cleanup based on ServiceDelegate finalization serviceClient.getOptions().setProperty(ServiceClient.AUTO_OPERATION_CLEANUP, false); } } } catch (AxisFault e) { throw ExceptionFactory.makeWebServiceException( Messages.getMessage("serviceClientCreateError"), e); } return serviceClient; }
AxisService service = new AxisService(); service.setParent(axisConfiguration); service.setName(serviceName);
public synchronized ServiceClient getServiceClient() { try { if (serviceClient == null) { ConfigurationContext configCtx = getServiceDescription().getAxisConfigContext(); AxisService axisSvc = getAxisService(); AxisConfiguration axisCfg = configCtx.getAxisConfiguration(); // The method synchronization prevents more than 1 service client being created // for the same EndpointDescription instance by multiple threads. We also need // to prevent different EndpointDescription instances from creating service client // instances using the same AxisService name under multiple threads. We do that by // synchronizing on the AxisConfiguration instance. synchronized(axisCfg) { if (axisCfg.getService(axisSvc.getName()) != null) { axisSvc.setName(axisSvc.getName() + uniqueID()); if (log.isDebugEnabled()) { log.debug("AxisService name is now " + axisSvc.getName() + ". This name should be unique; if not, errors might occur."); } } serviceClient = new ServiceClient(configCtx, axisSvc); // Disable automatic cleanup to avoid threading issues in Axis2 during the cleanup. JAXWS will // drive the cleanup based on ServiceDelegate finalization serviceClient.getOptions().setProperty(ServiceClient.AUTO_OPERATION_CLEANUP, false); } } } catch (AxisFault e) { throw ExceptionFactory.makeWebServiceException( Messages.getMessage("serviceClientCreateError"), e); } return serviceClient; }
AxisService service = new AxisService(); service.setParent(axisConfiguration); service.setName(serviceName);
axisService.setName(service.getQName().getLocalPart());
axisService.setName(service.getQName().getLocalPart());
name = name.startsWith("/") ? name.substring(1) : name; axisService.setName(name); axisService.setEndpointURL(endpointURL); axisService.setDocumentation("Tuscany configured AxisService for service: " + endpointURL);
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); } }
@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); }
axisService.setName(getServiceDescription().getServiceQName().getLocalPart()); axisService.setParent(axisConfig);
axisService.setName(getServiceDescription().getServiceQName().getLocalPart()); axisService.setParent(axisConfig);
/** * Tests starting a proxy service with correct axis configuration provided. * * @throws Exception if an exception occurs while configuring the axis configuration */ public void testStart() throws Exception { String proxyServiceName = "TestStartProxy"; SynapseConfiguration synCfg = new SynapseConfiguration(); AxisConfiguration axisCfg = new AxisConfiguration(); SynapseEnvironment synEnv = new Axis2SynapseEnvironment(new ConfigurationContext(axisCfg), synCfg); axisCfg.addParameter(SynapseConstants.SYNAPSE_ENV, synEnv); synCfg.setAxisConfiguration(axisCfg); ProxyService proxyService = new ProxyService(proxyServiceName); AxisService axisServiceForActivation = new AxisService(); axisServiceForActivation.setName(proxyServiceName); axisCfg.addToAllServicesMap(axisServiceForActivation); proxyService.setTargetInLineInSequence(new SequenceMediator()); proxyService.setTargetInLineOutSequence(new SequenceMediator()); proxyService.setTargetInLineFaultSequence(new SequenceMediator()); proxyService.start(synCfg); Assert.assertTrue("Underlying Axis service is not activated", axisServiceForActivation.isActive()); Assert.assertTrue("Proxy service is not running", proxyService.isRunning()); proxyService.stop(synCfg); }