use of org.apache.axis2.context.ServiceContext in project carbon-business-process by wso2.
the class AxisServiceUtils method getOperationClient.
public static OperationClient getOperationClient(BPELMessageContext partnerMessageContext, ConfigurationContext clientConfigCtx) throws AxisFault {
AxisService anonymousService = AnonymousServiceFactory.getAnonymousService(partnerMessageContext.getService(), partnerMessageContext.getPort(), clientConfigCtx.getAxisConfiguration(), partnerMessageContext.getCaller());
anonymousService.engageModule(clientConfigCtx.getAxisConfiguration().getModule("UEPModule"));
anonymousService.getParent().addParameter(BPELConstants.HIDDEN_SERVICE_PARAM, "true");
ServiceGroupContext sgc = new ServiceGroupContext(clientConfigCtx, (AxisServiceGroup) anonymousService.getParent());
ServiceContext serviceCtx = sgc.getServiceContext(anonymousService);
// get a reference to the DYNAMIC operation of the Anonymous Axis2 service
AxisOperation axisAnonymousOperation = anonymousService.getOperation(partnerMessageContext.isTwoWay() ? ServiceClient.ANON_OUT_IN_OP : ServiceClient.ANON_OUT_ONLY_OP);
Options clientOptions = cloneOptions(partnerMessageContext.getInMessageContext().getOptions());
clientOptions.setExceptionToBeThrownOnSOAPFault(false);
/* This value doesn't overrideend point config. */
clientOptions.setTimeOutInMilliSeconds(60000);
return axisAnonymousOperation.createClient(serviceCtx, clientOptions);
}
use of org.apache.axis2.context.ServiceContext in project carbon-business-process by wso2.
the class ServiceUtils method getOperationClient.
private static OperationClient getOperationClient(MessageContext partnerMessageContext, ConfigurationContext clientConfigCtx) throws AxisFault {
AxisService anonymousService = AnonymousServiceFactory.getAnonymousService(Constants.registrationService, Constants.REGISTRATION_PORT, clientConfigCtx.getAxisConfiguration(), Constants.HUMANTASK_COORDINATION_MODULE_NAME);
anonymousService.getParent().addParameter("hiddenService", "true");
ServiceGroupContext sgc = new ServiceGroupContext(clientConfigCtx, (AxisServiceGroup) anonymousService.getParent());
ServiceContext serviceCtx = sgc.getServiceContext(anonymousService);
AxisOperation axisAnonymousOperation = anonymousService.getOperation(ServiceClient.ANON_OUT_IN_OP);
Options clientOptions = cloneOptions(partnerMessageContext.getOptions());
clientOptions.setExceptionToBeThrownOnSOAPFault(false);
/* This value doesn't overrideend point config. */
clientOptions.setTimeOutInMilliSeconds(60000);
return axisAnonymousOperation.createClient(serviceCtx, clientOptions);
}
use of org.apache.axis2.context.ServiceContext in project MassBank-web by MassBank.
the class AdminActions method viewServiceContext.
@Action(name = "viewServiceContext")
public View viewServiceContext(HttpServletRequest req) throws AxisFault {
String type = req.getParameter("TYPE");
String sgID = req.getParameter("PID");
String ID = req.getParameter("ID");
ServiceGroupContext sgContext = configContext.getServiceGroupContext(sgID);
if (sgContext != null) {
AxisService service = sgContext.getDescription().getService(ID);
ServiceContext serviceContext = sgContext.getServiceContext(service);
req.setAttribute("ServiceContext", serviceContext);
req.setAttribute("TYPE", type);
} else {
req.setAttribute("ServiceContext", null);
req.setAttribute("TYPE", type);
}
return new View("viewServiceContext.jsp");
}
use of org.apache.axis2.context.ServiceContext in project carbon-apimgt by wso2.
the class WebsocketUtil method getSynapseMessageContext.
public static MessageContext getSynapseMessageContext(String tenantDomain) throws AxisFault {
org.apache.axis2.context.MessageContext axis2MsgCtx = createAxis2MessageContext();
ServiceContext svcCtx = new ServiceContext();
OperationContext opCtx = new OperationContext(new InOutAxisOperation(), svcCtx);
axis2MsgCtx.setServiceContext(svcCtx);
axis2MsgCtx.setOperationContext(opCtx);
if (!MultitenantConstants.SUPER_TENANT_DOMAIN_NAME.equals(tenantDomain)) {
ConfigurationContext tenantConfigCtx = TenantAxisUtils.getTenantConfigurationContext(tenantDomain, axis2MsgCtx.getConfigurationContext());
axis2MsgCtx.setConfigurationContext(tenantConfigCtx);
axis2MsgCtx.setProperty(MultitenantConstants.TENANT_DOMAIN, tenantDomain);
} else {
axis2MsgCtx.setProperty(MultitenantConstants.TENANT_DOMAIN, MultitenantConstants.SUPER_TENANT_DOMAIN_NAME);
}
return MessageContextCreatorForAxis2.getSynapseMessageContext(axis2MsgCtx);
}
use of org.apache.axis2.context.ServiceContext in project wso2-synapse by wso2.
the class OAuthUtilsTest method createMessageContext.
/**
* Create a empty message context
*
* @return A context with empty message
* @throws AxisFault on an error creating a context
*/
private static MessageContext createMessageContext() throws AxisFault {
Axis2SynapseEnvironment synapseEnvironment = new Axis2SynapseEnvironment(new SynapseConfiguration());
org.apache.axis2.context.MessageContext axis2MC = new org.apache.axis2.context.MessageContext();
axis2MC.setConfigurationContext(new ConfigurationContext(new AxisConfiguration()));
ServiceContext svcCtx = new ServiceContext();
OperationContext opCtx = new OperationContext(new InOutAxisOperation(), svcCtx);
axis2MC.setServiceContext(svcCtx);
axis2MC.setOperationContext(opCtx);
axis2MC.setTransportIn(new TransportInDescription("http"));
MessageContext mc = new Axis2MessageContext(axis2MC, new SynapseConfiguration(), synapseEnvironment);
mc.setMessageID(UIDGenerator.generateURNString());
mc.setEnvelope(OMAbstractFactory.getSOAP12Factory().createSOAPEnvelope());
mc.getEnvelope().addChild(OMAbstractFactory.getSOAP12Factory().createSOAPBody());
return mc;
}
Aggregations