Search in sources :

Example 6 with OperationInfo

use of org.apache.cxf.service.model.OperationInfo in project cxf by apache.

the class ServiceModelVisitor method walk.

public void walk() {
    begin(serviceInfo);
    begin(serviceInfo.getInterface());
    for (OperationInfo o : serviceInfo.getInterface().getOperations()) {
        begin(o);
        visitOperation(o);
        end(o);
    }
    end(serviceInfo.getInterface());
    for (EndpointInfo endpointInfo : serviceInfo.getEndpoints()) {
        begin(endpointInfo);
        end(endpointInfo);
    }
    for (BindingInfo bindingInfo : serviceInfo.getBindings()) {
        begin(bindingInfo);
        end(bindingInfo);
    }
    end(serviceInfo);
}
Also used : UnwrappedOperationInfo(org.apache.cxf.service.model.UnwrappedOperationInfo) OperationInfo(org.apache.cxf.service.model.OperationInfo) EndpointInfo(org.apache.cxf.service.model.EndpointInfo) BindingInfo(org.apache.cxf.service.model.BindingInfo)

Example 7 with OperationInfo

use of org.apache.cxf.service.model.OperationInfo in project cxf by apache.

the class ServiceModelVisitor method visitOperation.

private void visitOperation(OperationInfo o) {
    MessageInfo in = o.getInput();
    if (in != null) {
        begin(in);
        for (MessagePartInfo part : in.getMessageParts()) {
            begin(part);
            end(part);
        }
        end(in);
    }
    MessageInfo out = o.getOutput();
    if (out != null) {
        begin(out);
        for (MessagePartInfo part : out.getMessageParts()) {
            begin(part);
            end(part);
        }
        end(out);
    }
    for (FaultInfo f : o.getFaults()) {
        begin(f);
        for (MessagePartInfo part : f.getMessageParts()) {
            begin(part);
            end(part);
        }
        end(f);
    }
    if (o.isUnwrappedCapable()) {
        OperationInfo uop = o.getUnwrappedOperation();
        begin(uop);
        visitOperation(o.getUnwrappedOperation());
        end(uop);
    }
}
Also used : UnwrappedOperationInfo(org.apache.cxf.service.model.UnwrappedOperationInfo) OperationInfo(org.apache.cxf.service.model.OperationInfo) FaultInfo(org.apache.cxf.service.model.FaultInfo) MessagePartInfo(org.apache.cxf.service.model.MessagePartInfo) MessageInfo(org.apache.cxf.service.model.MessageInfo)

Example 8 with OperationInfo

use of org.apache.cxf.service.model.OperationInfo in project cxf by apache.

the class SimpleMethodDispatcher method getBindingOperation.

public BindingOperationInfo getBindingOperation(Method method, Endpoint endpoint) {
    Map<BindingInfo, BindingOperationInfo> bops = infoMap.get(method);
    if (bops == null) {
        return null;
    }
    BindingOperationInfo bop = bops.get(endpoint.getEndpointInfo().getBinding());
    if (bop == null) {
        OperationInfo o = methodToOp.get(method);
        if (o == null) {
            return null;
        }
        BindingInfo b = endpoint.getEndpointInfo().getBinding();
        for (BindingOperationInfo bop2 : b.getOperations()) {
            if (bop2.getOperationInfo().equals(o)) {
                bop2 = getRealOperation(o, bop2);
                bops.put(b, bop2);
                return bop2;
            }
        }
    }
    return bop;
}
Also used : OperationInfo(org.apache.cxf.service.model.OperationInfo) BindingOperationInfo(org.apache.cxf.service.model.BindingOperationInfo) BindingOperationInfo(org.apache.cxf.service.model.BindingOperationInfo) BindingInfo(org.apache.cxf.service.model.BindingInfo)

Example 9 with OperationInfo

use of org.apache.cxf.service.model.OperationInfo in project cxf by apache.

the class SoapPreProtocolOutInterceptorTest method setUpBindingOperationInfo.

private BindingOperationInfo setUpBindingOperationInfo(String nsuri, String opreq, String opresp, 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));
    return new BindingOperationInfo(null, opInfo);
}
Also used : ServiceInfo(org.apache.cxf.service.model.ServiceInfo) OperationInfo(org.apache.cxf.service.model.OperationInfo) BindingOperationInfo(org.apache.cxf.service.model.BindingOperationInfo) SoapOperationInfo(org.apache.cxf.binding.soap.model.SoapOperationInfo) BindingOperationInfo(org.apache.cxf.service.model.BindingOperationInfo) QName(javax.xml.namespace.QName) InterfaceInfo(org.apache.cxf.service.model.InterfaceInfo) Method(java.lang.reflect.Method)

Example 10 with OperationInfo

use of org.apache.cxf.service.model.OperationInfo in project cxf by apache.

the class XMLBindingFactory method createBindingInfo.

public BindingInfo createBindingInfo(ServiceInfo service, String namespace, Object config) {
    BindingInfo info = new BindingInfo(service, "http://cxf.apache.org/bindings/xformat");
    info.setName(new QName(service.getName().getNamespaceURI(), service.getName().getLocalPart() + "XMLBinding"));
    for (OperationInfo op : service.getInterface().getOperations()) {
        adjustConcreteNames(op.getInput());
        adjustConcreteNames(op.getOutput());
        BindingOperationInfo bop = info.buildOperation(op.getName(), op.getInputName(), op.getOutputName());
        info.addOperation(bop);
    }
    return info;
}
Also used : OperationInfo(org.apache.cxf.service.model.OperationInfo) BindingOperationInfo(org.apache.cxf.service.model.BindingOperationInfo) BindingOperationInfo(org.apache.cxf.service.model.BindingOperationInfo) QName(javax.xml.namespace.QName) BindingInfo(org.apache.cxf.service.model.BindingInfo)

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