Search in sources :

Example 31 with OperationInfo

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());
}
Also used : ServiceInfo(org.apache.cxf.service.model.ServiceInfo) BindingOperationInfo(org.apache.cxf.service.model.BindingOperationInfo) OperationInfo(org.apache.cxf.service.model.OperationInfo) BindingOperationInfo(org.apache.cxf.service.model.BindingOperationInfo) Message(org.apache.cxf.message.Message) LogEvent(org.apache.cxf.ext.logging.event.LogEvent) QName(javax.xml.namespace.QName) BindingInfo(org.apache.cxf.service.model.BindingInfo) DefaultLogEventMapper(org.apache.cxf.ext.logging.event.DefaultLogEventMapper) MessageImpl(org.apache.cxf.message.MessageImpl) ExchangeImpl(org.apache.cxf.message.ExchangeImpl) SoapBinding(org.apache.cxf.binding.soap.SoapBinding) Test(org.junit.Test) AbstractJaxWsTest(org.apache.cxf.jaxws.AbstractJaxWsTest)

Example 32 with OperationInfo

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);
    }
}
Also used : ServiceInfo(org.apache.cxf.service.model.ServiceInfo) OperationInfo(org.apache.cxf.service.model.OperationInfo) SoapOperationInfo(org.apache.cxf.binding.soap.model.SoapOperationInfo) BindingOperationInfo(org.apache.cxf.service.model.BindingOperationInfo) BindingOperationInfo(org.apache.cxf.service.model.BindingOperationInfo) SoapBindingInfo(org.apache.cxf.binding.soap.model.SoapBindingInfo) BindingInfo(org.apache.cxf.service.model.BindingInfo)

Example 33 with OperationInfo

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);
}
Also used : ServiceInfo(org.apache.cxf.service.model.ServiceInfo) OperationInfo(org.apache.cxf.service.model.OperationInfo) BindingOperationInfo(org.apache.cxf.service.model.BindingOperationInfo) BindingFaultInfo(org.apache.cxf.service.model.BindingFaultInfo) FaultInfo(org.apache.cxf.service.model.FaultInfo) QName(javax.xml.namespace.QName) InterfaceInfo(org.apache.cxf.service.model.InterfaceInfo) Method(java.lang.reflect.Method)

Example 34 with OperationInfo

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();
}
Also used : ServiceInfo(org.apache.cxf.service.model.ServiceInfo) OperationInfo(org.apache.cxf.service.model.OperationInfo) BindingOperationInfo(org.apache.cxf.service.model.BindingOperationInfo) EndpointInfo(org.apache.cxf.service.model.EndpointInfo) BindingOperationInfo(org.apache.cxf.service.model.BindingOperationInfo) BindingFaultInfo(org.apache.cxf.service.model.BindingFaultInfo) FaultInfo(org.apache.cxf.service.model.FaultInfo) BindingMessageInfo(org.apache.cxf.service.model.BindingMessageInfo) BindingInfo(org.apache.cxf.service.model.BindingInfo) InterfaceInfo(org.apache.cxf.service.model.InterfaceInfo) BindingFaultInfo(org.apache.cxf.service.model.BindingFaultInfo) MessageInfo(org.apache.cxf.service.model.MessageInfo) BindingMessageInfo(org.apache.cxf.service.model.BindingMessageInfo)

Example 35 with OperationInfo

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 });
}
Also used : BindingOperationInfo(org.apache.cxf.service.model.BindingOperationInfo) OperationInfo(org.apache.cxf.service.model.OperationInfo)

Aggregations

OperationInfo (org.apache.cxf.service.model.OperationInfo)135 BindingOperationInfo (org.apache.cxf.service.model.BindingOperationInfo)87 QName (javax.xml.namespace.QName)58 MessagePartInfo (org.apache.cxf.service.model.MessagePartInfo)44 MessageInfo (org.apache.cxf.service.model.MessageInfo)40 Test (org.junit.Test)38 ServiceInfo (org.apache.cxf.service.model.ServiceInfo)36 InterfaceInfo (org.apache.cxf.service.model.InterfaceInfo)31 Method (java.lang.reflect.Method)25 Endpoint (org.apache.cxf.endpoint.Endpoint)24 Service (org.apache.cxf.service.Service)22 BindingInfo (org.apache.cxf.service.model.BindingInfo)21 EndpointInfo (org.apache.cxf.service.model.EndpointInfo)19 SoapOperationInfo (org.apache.cxf.binding.soap.model.SoapOperationInfo)17 Exchange (org.apache.cxf.message.Exchange)17 ArrayList (java.util.ArrayList)13 UnwrappedOperationInfo (org.apache.cxf.service.model.UnwrappedOperationInfo)13 BindingMessageInfo (org.apache.cxf.service.model.BindingMessageInfo)12 Fault (org.apache.cxf.interceptor.Fault)10 Message (org.apache.cxf.message.Message)10