use of org.apache.cxf.service.model.OperationInfo in project cxf by apache.
the class SOAPLoggingTest method testSoap.
@Test
public void testSoap() {
DefaultLogEventMapper mapper = new DefaultLogEventMapper();
Message message = new MessageImpl();
ExchangeImpl exchange = new ExchangeImpl();
ServiceInfo service = new ServiceInfo();
BindingInfo info = new BindingInfo(service, "bindingId");
SoapBinding value = new SoapBinding(info);
exchange.put(Binding.class, value);
OperationInfo opInfo = new OperationInfo();
opInfo.setName(new QName("http://my", "Operation"));
BindingOperationInfo boi = new BindingOperationInfo(info, opInfo);
exchange.put(BindingOperationInfo.class, boi);
message.setExchange(exchange);
LogEvent event = mapper.map(message);
Assert.assertEquals("{http://my}Operation", event.getOperationName());
}
use of org.apache.cxf.service.model.OperationInfo in project cxf by apache.
the class DispatchImpl method addInvokeOperation.
private void addInvokeOperation(QName operationName, boolean oneWay) {
ServiceInfo info = client.getEndpoint().getEndpointInfo().getService();
OperationInfo invokeOpInfo = info.getInterface().getOperation(oneWay ? INVOKE_ONEWAY_QNAME : INVOKE_QNAME);
OperationInfo opInfo = info.getInterface().addOperation(operationName);
opInfo.setInput(invokeOpInfo.getInputName(), invokeOpInfo.getInput());
if (!oneWay) {
opInfo.setOutput(invokeOpInfo.getOutputName(), invokeOpInfo.getOutput());
}
for (BindingInfo bind : client.getEndpoint().getEndpointInfo().getService().getBindings()) {
BindingOperationInfo bo = new BindingOperationInfo(bind, opInfo);
bind.addOperation(bo);
}
}
use of org.apache.cxf.service.model.OperationInfo in project cxf by apache.
the class MAPAggregatorTest method setUpBindingOperationInfo.
private BindingOperationInfo setUpBindingOperationInfo(String nsuri, String opreq, String opresp, String opfault, Method method) {
ServiceInfo si = new ServiceInfo();
InterfaceInfo iinf = new InterfaceInfo(si, new QName(nsuri, method.getDeclaringClass().getSimpleName()));
OperationInfo opInfo = iinf.addOperation(new QName(nsuri, method.getName()));
opInfo.setProperty(Method.class.getName(), method);
opInfo.setInput(opreq, opInfo.createMessage(new QName(nsuri, opreq), Type.INPUT));
opInfo.setOutput(opresp, opInfo.createMessage(new QName(nsuri, opresp), Type.INPUT));
FaultInfo finfo = opInfo.addFault(new QName(nsuri, opfault), new QName(nsuri, opfault));
finfo.addMessagePart("fault");
return new TestBindingOperationInfo(opInfo);
}
use of org.apache.cxf.service.model.OperationInfo in project cxf by apache.
the class URIDomainExpressionTest method mockInfoObjects.
private void mockInfoObjects() {
si = control.createMock(ServiceInfo.class);
ei = control.createMock(EndpointInfo.class);
boi = control.createMock(BindingOperationInfo.class);
bmi = control.createMock(BindingMessageInfo.class);
bfi = control.createMock(BindingFaultInfo.class);
InterfaceInfo ii = control.createMock(InterfaceInfo.class);
EasyMock.expect(si.getTargetNamespace()).andReturn(TARGET_NAMESPACE).anyTimes();
EasyMock.expect(si.getName()).andReturn(SERVICE_QNAME).anyTimes();
EasyMock.expect(si.getInterface()).andReturn(ii).anyTimes();
EasyMock.expect(ii.getName()).andReturn(INTERFACE_QNAME).anyTimes();
EasyMock.expect(ei.getName()).andReturn(PORT_QNAME).anyTimes();
EasyMock.expect(ei.getService()).andReturn(si).anyTimes();
BindingInfo bi = control.createMock(BindingInfo.class);
OperationInfo oi = control.createMock(OperationInfo.class);
EasyMock.expect(boi.getName()).andReturn(OPERATION_QNAME).anyTimes();
EasyMock.expect(boi.getBinding()).andReturn(bi).anyTimes();
EasyMock.expect(bi.getName()).andReturn(BINDING_QNAME).anyTimes();
EasyMock.expect(boi.getOperationInfo()).andReturn(oi).anyTimes();
EasyMock.expect(oi.getInterface()).andReturn(ii).anyTimes();
EasyMock.expect(oi.getName()).andReturn(OPERATION_QNAME).anyTimes();
mi = control.createMock(MessageInfo.class);
EasyMock.expect(bmi.getMessageInfo()).andReturn(mi).anyTimes();
EasyMock.expect(mi.getName()).andReturn(MESSAGE_QNAME).anyTimes();
EasyMock.expect(bmi.getBindingOperation()).andReturn(boi).anyTimes();
FaultInfo fi = control.createMock(FaultInfo.class);
bfi = control.createMock(BindingFaultInfo.class);
EasyMock.expect(bfi.getBindingOperation()).andReturn(boi).anyTimes();
EasyMock.expect(bfi.getFaultInfo()).andReturn(fi).anyTimes();
EasyMock.expect(fi.getFaultName()).andReturn(FAULT_QNAME).anyTimes();
}
use of org.apache.cxf.service.model.OperationInfo in project cxf by apache.
the class Proxy method createSequenceResponse.
void createSequenceResponse(final Object createResponse, ProtocolVariation protocol) throws RMException {
LOG.fine("sending CreateSequenceResponse from client side");
RMConstants constants = protocol.getConstants();
final OperationInfo oi = reliableEndpoint.getEndpoint(protocol).getEndpointInfo().getService().getInterface().getOperation(constants.getCreateSequenceResponseOnewayOperationName());
// TODO: need to set relatesTo
invoke(oi, protocol, new Object[] { createResponse });
}
Aggregations