public SimpleMessageReceiver(String repoLocation, String confLocation, EventCallback callback) throws AxisFault{ configContext = ConfigurationContextFactory .createConfigurationContextFromFileSystem(repoLocation, confLocation); }
public static ConfigurationContext createConfigurationContextFromURIs( URL axis2xml, URL repositoy) throws AxisFault { return createConfigurationContext(new URLBasedAxisConfigurator(axis2xml, repositoy)); }
public Java2WSDLBuilder() { try { ConfigurationContext configCtx = ConfigurationContextFactory .createDefaultConfigurationContext(); axisConfig = configCtx.getAxisConfiguration(); } catch (Exception e) { throw new RuntimeException(e); } }
private void initConfigurationContext() throws Exception { HttpConnectionManager multiThreadedHttpConnectionManager = new MultiThreadedHttpConnectionManager(); HttpClient httpClient = new HttpClient(multiThreadedHttpConnectionManager); File configFile = new File(DEFAULT_AXIS2_XML); if (!configFile.exists()) { configurationContext = ConfigurationContextFactory.createDefaultConfigurationContext(); configurationContext.setProperty(HTTPConstants.DEFAULT_MAX_CONNECTIONS_PER_HOST, MAX_CONNECTIONS_PER_HOST); } else { configurationContext = ConfigurationContextFactory. createConfigurationContextFromFileSystem(DEFAULT_CLIENT_REPO, DEFAULT_AXIS2_XML); } configurationContext.setProperty(HTTPConstants.CACHED_HTTP_CLIENT, httpClient); configurationContext.setProperty(HTTPConstants.REUSE_HTTP_CLIENT, Constants.VALUE_TRUE); Map<String, TransportOutDescription> transportsOut = configurationContext.getAxisConfiguration().getTransportsOut(); for (TransportOutDescription transportOutDescription : transportsOut.values()) { if (Constants.TRANSPORT_HTTP.equals(transportOutDescription.getName()) || Constants.TRANSPORT_HTTPS.equals(transportOutDescription.getName())) { transportOutDescription.getSender().init(configurationContext, transportOutDescription); } } }
public ConfigurationContext run() throws AxisFault { ClassLoader oldTCCL = axis2Config.classLoaderContext.setContextClassLoader(); try { ConfigurationContext configurationContext = ConfigurationContextFactory.createConfigurationContextFromURIs(axis2Config.axis2xmlURL, axis2Config.repositoryURL); return configurationContext; } finally { if (oldTCCL != null) { Thread.currentThread().setContextClassLoader(oldTCCL); } } } });
private void initConfigurationContext() throws Exception { HttpConnectionManager multiThreadedHttpConnectionManager = new MultiThreadedHttpConnectionManager(); HttpClient httpClient = new HttpClient(multiThreadedHttpConnectionManager); File configFile = new File(DEFAULT_AXIS2_XML); if (!configFile.exists()) { configurationContext = ConfigurationContextFactory.createDefaultConfigurationContext(); configurationContext.setProperty(HTTPConstants.DEFAULT_MAX_CONNECTIONS_PER_HOST, MAX_CONNECTIONS_PER_HOST); } else { configurationContext = ConfigurationContextFactory. createConfigurationContextFromFileSystem(DEFAULT_CLIENT_REPO, DEFAULT_AXIS2_XML); } configurationContext.setProperty(HTTPConstants.CACHED_HTTP_CLIENT, httpClient); configurationContext.setProperty(HTTPConstants.REUSE_HTTP_CLIENT, Constants.VALUE_TRUE); Map<String, TransportOutDescription> transportsOut = configurationContext.getAxisConfiguration().getTransportsOut(); for (TransportOutDescription transportOutDescription : transportsOut.values()) { if (Constants.TRANSPORT_HTTP.equals(transportOutDescription.getName()) || Constants.TRANSPORT_HTTPS.equals(transportOutDescription.getName())) { transportOutDescription.getSender().init(configurationContext, transportOutDescription); } } }
URL fileURL = Axis2SoapClient.class.getResource( "/axis2-client/client.axis2.xml" ); configurationContext = ConfigurationContextFactory.createConfigurationContextFromURIs( fileURL, repoURL );
/** * Users extending this class can override this method to supply a custom ConfigurationContext * * @return ConfigurationContext * @throws AxisFault */ protected ConfigurationContext createDefaultConfigurationContext() throws AxisFault { return ConfigurationContextFactory.createConfigurationContextFromFileSystem(null); } }
public Java2WSDLBuilder(OutputStream out, String className, ClassLoader classLoader) { try { ConfigurationContext configCtx = ConfigurationContextFactory .createDefaultConfigurationContext(); axisConfig = configCtx.getAxisConfiguration(); this.out = out; this.className = className; this.classLoader = classLoader; } catch (Exception e) { throw new RuntimeException(e); } }
public static ConfigurationContext createConfigurationContextFromURIs( URL axis2xml, URL repositoy) throws AxisFault { return createConfigurationContext(new URLBasedAxisConfigurator(axis2xml, repositoy)); }
private static void invokeTimeService() { String endPointUrl = "xmpp://synapse.demo.0@gmail.com/" + "TimeService"; EndpointReference targetEPR = new EndpointReference(endPointUrl); try { ConfigurationContext ctx = ConfigurationContextFactory.createConfigurationContextFromURIs( XMPPSampleClient.class.getResource("axis2.xml"), null); OMElement payload = getPayload(); Options options = new Options(); options.setProperty(XMPPConstants.XMPP_SERVER_TYPE, XMPPConstants.XMPP_SERVER_TYPE_GOOGLETALK); options.setProperty(XMPPConstants.XMPP_SERVER_URL, XMPPConstants.GOOGLETALK_URL); options.setProperty(XMPPConstants.XMPP_SERVER_USERNAME, "synapse.demo.0"); options.setProperty(XMPPConstants.XMPP_SERVER_PASSWORD, "mailpassword"); options.setTo(targetEPR); options.setAction("urn:getServerTime"); ServiceClient sender = new ServiceClient(ctx,null); sender.setOptions(options); OMElement result = sender.sendReceive(payload); XMLPrettyPrinter.prettify(result, System.out); } catch (Exception e) { e.printStackTrace(); } }
public SimpleAxis2Server ( String repoLocation, String confLocation) throws Exception { super(false); configContext = ConfigurationContextFactory .createConfigurationContextFromFileSystem(repoLocation, confLocation); }
public Java2WSDLBuilder() { try { ConfigurationContext configCtx = ConfigurationContextFactory .createDefaultConfigurationContext(); axisConfig = configCtx.getAxisConfiguration(); } catch (Exception e) { throw new RuntimeException(e); } }
private boolean configureAxis() throws Exception { log.info("configuring axis"); URL conf = new File(resourcesDir, "axis/conf/axis2.xml").toURI().toURL(); URL repo = new File(resourcesDir, "axis/").toURI().toURL(); AxisConfigurator ac = new AxisConfiguratorImpl(conf, repo); configurationContext = ConfigurationContextFactory.createConfigurationContext(ac); new ListenerManager().init(configurationContext); return true; }
public SimpleAxis2Server ( String repoLocation, String confLocation) throws Exception { super(false); configContext = ConfigurationContextFactory .createConfigurationContextFromFileSystem(repoLocation, confLocation); }
public Java2WSDLBuilder(OutputStream out, String className, ClassLoader classLoader) { try { ConfigurationContext configCtx = ConfigurationContextFactory .createDefaultConfigurationContext(); axisConfig = configCtx.getAxisConfiguration(); this.out = out; this.className = className; this.classLoader = classLoader; } catch (Exception e) { throw new RuntimeException(e); } }
String path, String axis2xml) throws AxisFault { return createConfigurationContext(new FileSystemConfigurator(path, axis2xml));
public static ConfigurationContext createConfigurationContextFromFileSystem(String path) throws AxisFault { return createConfigurationContextFromFileSystem(path, null); }
public static String getHostWithHTTP(){ String host = ""; try { host += "http://" + NetworkUtils.getLocalHostname() + ":" + CarbonUtils.getTransportPort(ConfigurationContextFactory.createDefaultConfigurationContext(), "http"); } catch (Exception e) { log.error("Error occurred while getting host", e); } return host; } }
String path, String axis2xml) throws AxisFault { return createConfigurationContext(new FileSystemConfigurator(path, axis2xml));