本文整理汇总了Java中org.apache.axis2.context.ConfigurationContext.createServiceGroupContext方法的典型用法代码示例。如果您正苦于以下问题:Java ConfigurationContext.createServiceGroupContext方法的具体用法?Java ConfigurationContext.createServiceGroupContext怎么用?Java ConfigurationContext.createServiceGroupContext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.axis2.context.ConfigurationContext
的用法示例。
在下文中一共展示了ConfigurationContext.createServiceGroupContext方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createAdressedEnabledClientSide
import org.apache.axis2.context.ConfigurationContext; //导入方法依赖的package包/类
public static ServiceContext createAdressedEnabledClientSide(
AxisService service) throws AxisFault {
File file = getAddressingMARFile();
TestCase.assertTrue(file.exists());
ConfigurationContext configContext = ConfigurationContextFactory
.createConfigurationContextFromFileSystem(
TestingUtils.prefixBaseDirectory("target/test-resources/integrationRepo"), null);
AxisModule axisModule = DeploymentEngine.buildModule(file,
configContext.getAxisConfiguration());
configContext.getAxisConfiguration().addModule(axisModule);
configContext.getAxisConfiguration().addService(service);
ServiceGroupContext serviceGroupContext =
configContext.createServiceGroupContext(service.getAxisServiceGroup());
return serviceGroupContext.getServiceContext(service);
}
示例2: createMockMessageContext
import org.apache.axis2.context.ConfigurationContext; //导入方法依赖的package包/类
public static MessageContext createMockMessageContext(String payload) throws AxisFault {
MessageContext inMC = new MessageContext();
SOAPEnvelope envelope = OMAbstractFactory.getSOAP11Factory().getDefaultEnvelope();
OMDocument omDoc = OMAbstractFactory.getSOAP11Factory().createOMDocument();
omDoc.addChild(envelope);
envelope.getBody().addChild(TestUtils.createOMElement(payload));
inMC.setEnvelope(envelope);
AxisConfiguration axisConfig = new AxisConfiguration();
AxisService as = new AxisService();
as.setName("ScriptService");
AxisServiceGroup asg = new AxisServiceGroup(axisConfig);
asg.addService(as);
as.addParameter(new Parameter("script.js",
"function invoke(inMC, outMC) { outMC.setPayloadXML(" +
payload + ")}"));
ConfigurationContext cfgCtx = new ConfigurationContext(axisConfig);
ServiceGroupContext sgc = cfgCtx.createServiceGroupContext(asg);
inMC.setAxisService(as);
inMC.setServiceContext(sgc.getServiceContext(as));
return inMC;
}
示例3: createAndFillContexts
import org.apache.axis2.context.ConfigurationContext; //导入方法依赖的package包/类
private void createAndFillContexts(AxisService service,
MessageContext msgContext,
SessionContext sessionContext) throws AxisFault {
ServiceGroupContext serviceGroupContext;
AxisServiceGroup axisServiceGroup = service.getAxisServiceGroup();
ConfigurationContext configCtx = msgContext.getConfigurationContext();
serviceGroupContext = configCtx.createServiceGroupContext(axisServiceGroup);
msgContext.setServiceGroupContext(serviceGroupContext);
ServiceContext serviceContext = serviceGroupContext.getServiceContext(service);
msgContext.setServiceContext(serviceContext);
if (sessionContext != null) {
sessionContext.addServiceContext(serviceContext);
sessionContext.addServiceGroupContext(serviceGroupContext);
}
}
示例4: fillServiceContextAndServiceGroupContext
import org.apache.axis2.context.ConfigurationContext; //导入方法依赖的package包/类
private static ServiceContext fillServiceContextAndServiceGroupContext(AxisService axisService,
ConfigurationContext configurationContext)
throws AxisFault {
String serviceGroupContextId = UIDGenerator.generateURNString();
ServiceGroupContext serviceGroupContext =
configurationContext.createServiceGroupContext(axisService.getAxisServiceGroup());
serviceGroupContext.setId(serviceGroupContextId);
configurationContext.addServiceGroupContextIntoSoapSessionTable(serviceGroupContext);
return serviceGroupContext.getServiceContext(axisService);
}
示例5: testFindService
import org.apache.axis2.context.ConfigurationContext; //导入方法依赖的package包/类
public void testFindService() throws AxisFault {
MessageContext messageContext;
AxisConfiguration ac = new AxisConfiguration();
ConfigurationContext cc = new ConfigurationContext(ac);
AxisService as1 = new AxisService("Service1");
AxisServiceGroup sg = new AxisServiceGroup(ac);
sg.addService(as1);
ServiceGroupContext sgc = cc.createServiceGroupContext(sg);
ServiceContext sc1 = sgc.getServiceContext(as1);
AxisService as2 = new AxisService("Service2");
sg.addService(as2);
ServiceContext sc2 = sgc.getServiceContext(as2);
ac.addService(as1);
ac.addService(as2);
AxisOperation operation1 = new InOnlyAxisOperation(new QName("operation1"));
AxisOperation operation2 = new InOnlyAxisOperation(new QName("operation2"));
as1.addOperation(operation1);
as2.addOperation(operation2);
OperationContext oc1 = sc1.createOperationContext(operation1);
OperationContext oc2 = sc2.createOperationContext(operation2);
cc.registerOperationContext("urn:org.apache.axis2.dispatchers.messageid:123", oc1);
cc.registerOperationContext("urn:org.apache.axis2.dispatchers.messageid:456", oc2);
messageContext = cc.createMessageContext();
messageContext
.addRelatesTo(new RelatesTo("urn:org.apache.axis2.dispatchers.messageid:456"));
RelatesToBasedServiceDispatcher ruisd = new RelatesToBasedServiceDispatcher();
ruisd.invoke(messageContext);
assertEquals(as2, messageContext.getAxisService());
}
示例6: testFindOperation
import org.apache.axis2.context.ConfigurationContext; //导入方法依赖的package包/类
public void testFindOperation() throws AxisFault {
MessageContext messageContext;
AxisService as1 = new AxisService("Service1");
AxisConfiguration ac = new AxisConfiguration();
ac.addService(as1);
AxisOperation operation1 = new InOnlyAxisOperation(new QName("operation1"));
AxisOperation operation2 = new InOnlyAxisOperation(new QName("operation2"));
as1.addOperation(operation1);
as1.addOperation(operation2);
ConfigurationContext cc = new ConfigurationContext(ac);
ServiceGroupContext sgc = cc.createServiceGroupContext(as1.getAxisServiceGroup());
ServiceContext serviceContext = sgc.getServiceContext(as1);
OperationContext oc1 = serviceContext.createOperationContext(operation1);
OperationContext oc2 = serviceContext.createOperationContext(operation2);
cc.registerOperationContext("urn:org.apache.axis2.dispatchers.messageid:123", oc1);
cc.registerOperationContext("urn:org.apache.axis2.dispatchers.messageid:456", oc2);
messageContext = cc.createMessageContext();
messageContext
.addRelatesTo(new RelatesTo("urn:org.apache.axis2.dispatchers.messageid:456"));
messageContext.setAxisService(as1);
RelatesToBasedOperationDispatcher ruisd = new RelatesToBasedOperationDispatcher();
ruisd.invoke(messageContext);
assertEquals(operation2, messageContext.getAxisOperation());
}
示例7: setUp
import org.apache.axis2.context.ConfigurationContext; //导入方法依赖的package包/类
protected void setUp() throws Exception {
AxisConfiguration engineRegistry = new AxisConfiguration();
configContext = new ConfigurationContext(engineRegistry);
TransportOutDescription transport = new TransportOutDescription("null");
transport.setSender(new CommonsHTTPTransportSender());
TransportInDescription transportIn = new TransportInDescription("null");
AxisOperation axisOp = new InOutAxisOperation(operationName);
AxisService service = new AxisService(serviceName.getLocalPart());
axisOp.setMessageReceiver(new MessageReceiver() {
public void receive(MessageContext messageCtx) throws AxisFault {
// TODO Auto-generated method stub
}
});
engineRegistry.addService(service);
service.addOperation(axisOp);
mc = configContext.createMessageContext();
mc.setTransportIn(transportIn);
mc.setTransportOut(transport);
ServiceGroupContext sgc = configContext.createServiceGroupContext(
service.getAxisServiceGroup());
ServiceContext sc = sgc.getServiceContext(service);
OperationContext opContext = sc.createOperationContext(axisOp);
mc.setOperationContext(opContext);
mc.setTransportOut(transport);
mc.setProperty(MessageContext.TRANSPORT_OUT, System.out);
mc.setServerSide(true);
SOAPFactory omFac = OMAbstractFactory.getSOAP11Factory();
mc.setEnvelope(omFac.getDefaultEnvelope());
mc.setWSAAction(operationName.getLocalPart());
mc.setSoapAction(operationName.getLocalPart());
System.out.flush();
}
示例8: testCheckUsingAdressingOnClient
import org.apache.axis2.context.ConfigurationContext; //导入方法依赖的package包/类
public void testCheckUsingAdressingOnClient() throws Exception {
// Need to create full description hierarchy to prevent NullPointerExceptions
AxisOperation axisOperation = new OutInAxisOperation(new QName("Temp"));
AxisService axisService = new AxisService("Temp");
AxisConfiguration axisConfiguration = new AxisConfiguration();
axisService.addOperation(axisOperation);
axisConfiguration.addService(axisService);
ConfigurationContext configurationContext = new ConfigurationContext(axisConfiguration);
// Make addressing required using the same property as the AddressingConfigurator on the request
MessageContext request = configurationContext.createMessageContext();
request.setProperty(AddressingConstants.ADDRESSING_REQUIREMENT_PARAMETER, AddressingConstants.ADDRESSING_REQUIRED);
// Create a response to invoke the in handler on
MessageContext response = configurationContext.createMessageContext();
// Link the response to the request message context using the context hierarchy
ServiceGroupContext serviceGroupContext = configurationContext.createServiceGroupContext(axisService.getAxisServiceGroup());
ServiceContext serviceContext = serviceGroupContext.getServiceContext(axisService);
OperationContext opContext = axisOperation.findOperationContext(request, serviceContext);
axisOperation.registerOperationContext(request, opContext);
request.setServiceContext(serviceContext);
response.setServiceContext(serviceContext);
request.setOperationContext(opContext);
response.setOperationContext(opContext);
// Invoke the in handler for a response message without addressing headers
response.setEnvelope(TestUtil.getSOAPEnvelope("addressingDisabledTest.xml"));
inHandler.invoke(response);
// Check an exception is thrown by the validation handler because the client
// requires addressing but the response message does not have addressing headers
try {
validationHandler.invoke(response);
fail("An AxisFault should have been thrown due to the absence of addressing headers.");
} catch (AxisFault axisFault) {
// Confirm this is the correct fault
assertEquals("Wrong fault code",
new QName(Final.FAULT_ADDRESSING_HEADER_REQUIRED),
axisFault.getFaultCode());
}
}