Java Code Examples for org.apache.cxf.service.model.BindingOperationInfo#getUnwrappedOperation()

The following examples show how to use org.apache.cxf.service.model.BindingOperationInfo#getUnwrappedOperation() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: cxf   File: EffectivePolicyImpl.java    License: Apache License 2.0 5 votes vote down vote up
Assertor initialisePolicy(EndpointInfo ei,
                      BindingOperationInfo boi,
                      PolicyEngine engine,
                      boolean requestor,
                      boolean request,
                      Assertor assertor,
                      Message m) {

    if (boi.isUnwrapped()) {
        boi = boi.getUnwrappedOperation();
    }

    BindingMessageInfo bmi = request ? boi.getInput() : boi.getOutput();
    EndpointPolicy ep;
    if (requestor) {
        ep = engine.getClientEndpointPolicy(ei, getAssertorAs(assertor, Conduit.class), m);
    } else {
        ep = engine.getServerEndpointPolicy(ei, getAssertorAs(assertor, Destination.class), m);
    }
    policy = ep.getPolicy();
    if (ep instanceof EndpointPolicyImpl) {
        assertor = ((EndpointPolicyImpl)ep).getAssertor();
    }

    policy = policy.merge(((PolicyEngineImpl)engine).getAggregatedOperationPolicy(boi, m));
    if (null != bmi) {
        policy = policy.merge(((PolicyEngineImpl)engine).getAggregatedMessagePolicy(bmi, m));
    }
    policy = policy.normalize(engine.getRegistry(), true);
    return assertor;
}
 
Example 2
Source Project: cxf   File: SimpleMethodDispatcher.java    License: Apache License 2.0 5 votes vote down vote up
private BindingOperationInfo getRealOperation(OperationInfo o, BindingOperationInfo bop) {
    BindingOperationInfo unwrappedOp = bop.getUnwrappedOperation();
    if (unwrappedOp != null
        && unwrappedOp.getOperationInfo().equals(o.getUnwrappedOperation())) {
        return unwrappedOp;
    }
    return bop;
}
 
Example 3
Source Project: cxf   File: ClientImpl.java    License: Apache License 2.0 5 votes vote down vote up
public Object[] invoke(QName operationName, Object... params) throws Exception {
    BindingOperationInfo op = getEndpoint().getEndpointInfo().getBinding().getOperation(operationName);
    if (op == null) {
        throw new UncheckedException(
            new org.apache.cxf.common.i18n.Message("NO_OPERATION", LOG, operationName));
    }

    if (op.isUnwrappedCapable()) {
        op = op.getUnwrappedOperation();
    }

    return invoke(op, params);
}
 
Example 4
Source Project: cxf   File: ClientImpl.java    License: Apache License 2.0 5 votes vote down vote up
public void invoke(ClientCallback callback,
                   QName operationName,
                   Object... params) throws Exception {
    BindingOperationInfo op = getEndpoint().getEndpointInfo().getBinding().getOperation(operationName);
    if (op == null) {
        throw new UncheckedException(
            new org.apache.cxf.common.i18n.Message("NO_OPERATION", LOG, operationName));
    }

    if (op.isUnwrappedCapable()) {
        op = op.getUnwrappedOperation();
    }

    invoke(callback, op, params);
}
 
Example 5
Source Project: cxf   File: InternalContextUtils.java    License: Apache License 2.0 4 votes vote down vote up
/**
 * Get action from service model.
 *
 * @param message the current message
 * @param fault the fault if one is set
 */
private static String getActionFromServiceModel(Message message,
                                                Exception fault) {
    String action = null;
    BindingOperationInfo bindingOpInfo =
        message.getExchange().getBindingOperationInfo();
    if (bindingOpInfo != null) {
        if (bindingOpInfo.isUnwrappedCapable()) {
            bindingOpInfo = bindingOpInfo.getUnwrappedOperation();
        }
        if (fault == null) {
            action = (String)message.get(ContextUtils.ACTION);
            if (StringUtils.isEmpty(action)) {
                action = (String) message.get(SoapBindingConstants.SOAP_ACTION);
            }
            if (action == null || "".equals(action)) {
                MessageInfo msgInfo =
                    ContextUtils.isRequestor(message)
                    ? bindingOpInfo.getOperationInfo().getInput()
                    : bindingOpInfo.getOperationInfo().getOutput();
                String cachedAction = (String)msgInfo.getProperty(ContextUtils.ACTION);
                if (cachedAction == null) {
                    action = getActionFromMessageAttributes(msgInfo);
                } else {
                    action = cachedAction;
                }
                if (action == null && ContextUtils.isRequestor(message)) {
                    SoapOperationInfo soi = getSoapOperationInfo(bindingOpInfo);
                    action = soi == null ? null : soi.getAction();
                    action = StringUtils.isEmpty(action) ? null : action;
                }
            }
        } else {
            Throwable t = fault.getCause();

            // FaultAction attribute is not defined in
            // http://www.w3.org/2005/02/addressing/wsdl schema
            for (BindingFaultInfo bfi : bindingOpInfo.getFaults()) {
                FaultInfo fi = bfi.getFaultInfo();
                if (fi.size() == 0) {
                    continue;
                }
                if (t != null && matchFault(t, fi)) {
                    if (fi.getExtensionAttributes() == null) {
                        continue;
                    }
                    String attr = (String)
                        fi.getExtensionAttributes().get(Names.WSAW_ACTION_QNAME);
                    if (attr == null) {
                        attr = (String)
                            fi.getExtensionAttributes()
                                .get(new QName(Names.WSA_NAMESPACE_WSDL_NAME_OLD,
                                                Names.WSAW_ACTION_NAME));
                    }
                    if (attr != null) {
                        action = attr;
                        break;
                    }
                }
            }
        }
    }
    if (LOG.isLoggable(Level.FINE)) {
        LOG.fine("action determined from service model: " + action);
    }
    return action;
}