Search in sources :

Example 1 with ConfigurationContext

use of org.apache.axis2.context.ConfigurationContext in project tdi-studio-se by Talend.

the class MSCRMClient method getConfigurationContext.

private static ConfigurationContext getConfigurationContext() throws AxisFault {
    String workingDirectory = System.getProperty("user.dir");
    String fileSeperator = System.getProperty("file.separator");
    String pathToAxis2File = workingDirectory + fileSeperator + "src" + fileSeperator + "axis2.xml";
    logger.debug("Working directory: " + workingDirectory);
    logger.debug("Path to Axis2.xml file: " + pathToAxis2File);
    ConfigurationContext ctx;
    try {
        // ctx = ConfigurationContextFactory.createConfigurationContextFromFileSystem(workingDirectory,
        // pathToAxis2File);
        ctx = ConfigurationContextFactory.createConfigurationContextFromURIs(MSCRMClient.class.getClassLoader().getResource("org/talend/ms/crm/sdk/axis2_mscrm.xml"), null);
    } catch (AxisFault e) {
        logger.error(e.getMessage());
        throw e;
    }
    return ctx;
}
Also used : AxisFault(org.apache.axis2.AxisFault) ConfigurationContext(org.apache.axis2.context.ConfigurationContext)

Example 2 with ConfigurationContext

use of org.apache.axis2.context.ConfigurationContext in project MassBank-web by MassBank.

the class AdminActions method viewServiceGroupContext.

@Action(name = "viewServiceGroupContext")
public View viewServiceGroupContext(HttpServletRequest req) {
    String type = req.getParameter("TYPE");
    String sgID = req.getParameter("ID");
    ServiceGroupContext sgContext = configContext.getServiceGroupContext(sgID);
    req.getSession().setAttribute("ServiceGroupContext", sgContext);
    req.getSession().setAttribute("TYPE", type);
    req.getSession().setAttribute("ConfigurationContext", configContext);
    return new View("viewServiceGroupContext.jsp");
}
Also used : ServiceGroupContext(org.apache.axis2.context.ServiceGroupContext)

Example 3 with ConfigurationContext

use of org.apache.axis2.context.ConfigurationContext in project wso2-axis2-transports by wso2.

the class UDPTest method getClientCfgCtx.

public ConfigurationContext getClientCfgCtx() throws Exception {
    ConfigurationContext cfgCtx = ConfigurationContextFactory.createConfigurationContext(new CustomAxisConfigurator());
    AxisConfiguration axisCfg = cfgCtx.getAxisConfiguration();
    axisCfg.engageModule("addressing");
    TransportInDescription trpInDesc = new TransportInDescription("udp");
    trpInDesc.setReceiver(new UDPListener());
    axisCfg.addTransportIn(trpInDesc);
    TransportOutDescription trpOutDesc = new TransportOutDescription("udp");
    trpOutDesc.setSender(new UDPSender());
    axisCfg.addTransportOut(trpOutDesc);
    return cfgCtx;
}
Also used : ConfigurationContext(org.apache.axis2.context.ConfigurationContext) AxisConfiguration(org.apache.axis2.engine.AxisConfiguration) CustomAxisConfigurator(org.apache.axis2.transport.CustomAxisConfigurator) TransportInDescription(org.apache.axis2.description.TransportInDescription) TransportOutDescription(org.apache.axis2.description.TransportOutDescription)

Example 4 with ConfigurationContext

use of org.apache.axis2.context.ConfigurationContext in project wso2-axis2-transports by wso2.

the class XMPPSender method init.

/**
 * Initialize the transport sender by reading pre-defined connection factories for
 * outgoing messages. These will create sessions (one per each destination dealt with)
 * to be used when messages are being sent.
 * @param confContext the configuration context
 * @param transportOut the transport sender definition from axis2.xml
 * @throws AxisFault on error
 */
public void init(ConfigurationContext confContext, TransportOutDescription transportOut) throws AxisFault {
    // if connection details are available from axis configuration
    // use those & connect to jabber server(s)
    serverCredentials = new XMPPServerCredentials();
    getConnectionDetailsFromAxisConfiguration(transportOut);
    defaultConnectionFactory = new XMPPConnectionFactory();
}
Also used : XMPPServerCredentials(org.apache.axis2.transport.xmpp.util.XMPPServerCredentials) XMPPConnectionFactory(org.apache.axis2.transport.xmpp.util.XMPPConnectionFactory)

Example 5 with ConfigurationContext

use of org.apache.axis2.context.ConfigurationContext in project wso2-axis2-transports by wso2.

the class AbstractTransportTest method getClientCfgCtx.

/**
 * Get the default axis2 configuration context for a client
 * @return
 * @throws Exception
 */
protected ConfigurationContext getClientCfgCtx() throws Exception {
    AxisConfiguration axisCfg = new AxisConfiguration();
    ConfigurationContext cfgCtx = new ConfigurationContext(axisCfg);
    return cfgCtx;
}
Also used : AxisConfiguration(org.apache.axis2.engine.AxisConfiguration) ConfigurationContext(org.apache.axis2.context.ConfigurationContext)

Aggregations

ConfigurationContext (org.apache.axis2.context.ConfigurationContext)143 AxisConfiguration (org.apache.axis2.engine.AxisConfiguration)97 Axis2SynapseEnvironment (org.apache.synapse.core.axis2.Axis2SynapseEnvironment)58 Parameter (org.apache.axis2.description.Parameter)52 SynapseConfiguration (org.apache.synapse.config.SynapseConfiguration)52 Test (org.junit.Test)48 SynapseEnvironment (org.apache.synapse.core.SynapseEnvironment)45 OMElement (org.apache.axiom.om.OMElement)42 AxisFault (org.apache.axis2.AxisFault)27 AxisService (org.apache.axis2.description.AxisService)25 EndpointReference (org.apache.axis2.addressing.EndpointReference)23 MessageContext (org.apache.synapse.MessageContext)22 Options (org.apache.axis2.client.Options)21 MessageContext (org.apache.axis2.context.MessageContext)21 ServiceContext (org.apache.axis2.context.ServiceContext)15 Axis2MessageContext (org.apache.synapse.core.axis2.Axis2MessageContext)15 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)15 HashMap (java.util.HashMap)14 TransportOutDescription (org.apache.axis2.description.TransportOutDescription)14 ArrayList (java.util.ArrayList)13