private boolean isOneWay(Message message) { Exchange ex = message.getExchange(); BindingOperationInfo binding = ex.getBindingOperationInfo(); if (null != binding && null != binding.getOperationInfo() && binding.getOperationInfo().isOneWay()) { return true; } return false; } }
private void getBindingOperationForEmptyBody(Collection<OperationInfo> operations, Endpoint ep, Exchange exchange) { // TO DO : check duplicate operation with no input and also check if the action matches for (OperationInfo op : operations) { MessageInfo bmsg = op.getInput(); List<MessagePartInfo> bparts = bmsg.getMessageParts(); if (bparts.size() == 0 || (bparts.size() == 1 && XMLSchemaQNames.XSD_ANY.equals(bparts.get(0).getTypeQName()))) { BindingOperationInfo boi = ep.getEndpointInfo().getBinding().getOperation(op); exchange.put(BindingOperationInfo.class, boi); exchange.put(OperationInfo.class, op); exchange.setOneWay(op.isOneWay()); } } }
private void getBindingOperationForEmptyBody(Collection<OperationInfo> operations, Endpoint ep, Exchange exchange) { // TO DO : check duplicate operation with no input and also check if the action matches for (OperationInfo op : operations) { MessageInfo bmsg = op.getInput(); List<MessagePartInfo> bparts = bmsg.getMessageParts(); if (bparts.size() == 0 || (bparts.size() == 1 && XMLSchemaQNames.XSD_ANY.equals(bparts.get(0).getTypeQName()))) { BindingOperationInfo boi = ep.getEndpointInfo().getBinding().getOperation(op); exchange.put(BindingOperationInfo.class, boi); exchange.put(OperationInfo.class, op); exchange.setOneWay(op.isOneWay()); } } }
public void handleResponse(Map<String, Object> ctx, Object[] res) { try { super.handleResponse(ctx, res); } finally { // add cookies to the cookie store if (endpoint.getCookieHandler() != null) { try { Map<String, List<String>> cxfHeaders = CastUtils.cast((Map<?, ?>)cxfExchange.getInMessage().get(Message.PROTOCOL_HEADERS)); endpoint.getCookieHandler().storeCookies(camelExchange, endpoint.getRequestUri(camelExchange), cxfHeaders); } catch (IOException e) { LOG.error("Cannot store cookies", e); } } // bind the CXF response to Camel exchange and // call camel callback // for one way messages callback is already called in // process method of org.apache.camel.component.cxf.CxfProducer if (!boi.getOperationInfo().isOneWay()) { endpoint.getCxfBinding().populateExchangeFromCxfResponse(camelExchange, cxfExchange, ctx); camelAsyncCallback.done(false); } if (LOG.isDebugEnabled()) { LOG.debug("{} calling handleResponse", Thread.currentThread().getName()); } } }
if (boi.getOperationInfo().isOneWay()) { callback.done(false);
private void getBindingOperationForEmptyBody(Collection<OperationInfo> operations, Endpoint ep, Exchange exchange) { // TO DO : check duplicate operation with no input and also check if the action matches for (OperationInfo op : operations) { MessageInfo bmsg = op.getInput(); int bPartsNum = bmsg.getMessagePartsNumber(); if (bPartsNum == 0 || (bPartsNum == 1 && Constants.XSD_ANYTYPE.equals(bmsg.getFirstMessagePart().getTypeQName()))) { BindingOperationInfo boi = ep.getEndpointInfo().getBinding().getOperation(op); exchange.put(BindingOperationInfo.class, boi); exchange.setOneWay(op.isOneWay()); } } }
@Override public void end(OperationInfo op) { // we only process the wrapped operation, not the unwrapped alternative. if (op.isUnwrapped()) { isInUnwrappedOperation = false; return; } isWrapped = op.isUnwrappedCapable(); StringBuilder parameterList = new StringBuilder(); inputParameterNames = new ArrayList<>(); if (isWrapped) { collectWrapperElementInfo(); } else { collectUnwrappedInputInfo(); } buildParameterList(parameterList); MessageInfo outputMessage = op.getOutput(); nonVoidOutput = outputMessage != null && outputMessage.getMessageParts().size() != 0; if (!op.isOneWay()) { buildSuccessFunction(outputMessage); buildErrorFunction(); // fault part some day. } buildOperationFunction(parameterList); createInputSerializer(); if (nonVoidOutput) { createResponseDeserializer(outputMessage); } }
if (!boi.getOperationInfo().isOneWay()) { endpoint.getCxfBinding().populateExchangeFromCxfResponse(camelExchange, cxfExchange, responseContext);
ex.setOneWay(operation.getOperationInfo().isOneWay());
ex.setOneWay(operation.getOperationInfo().isOneWay());
if (operation.isOneWay()) { method.setStyle(OperationType.ONE_WAY); } else {
public void handleMessage(JBIMessage message) throws Fault { Exchange ex = message.getExchange(); Endpoint ep = ex.get(Endpoint.class); BindingOperationInfo boi = ex.get(BindingOperationInfo.class); if (boi == null) { if (message.getJbiExchange().getOperation() != null) { BindingInfo service = ep.getEndpointInfo().getBinding(); boi = getBindingOperationInfo(service, message.getJbiExchange().getOperation()); if (boi == null) { throw new Fault(new Message("UNKNOWN_OPERATION", BUNDLE, message.getJbiExchange().getOperation().toString())); } } else { throw new Fault(new Message("UNKNOWN_OPERATION", BUNDLE, message.getJbiExchange().getInterfaceName().toString())); } ex.put(BindingOperationInfo.class, boi); ex.put(OperationInfo.class, boi.getOperationInfo()); ex.setOneWay(boi.getOperationInfo().isOneWay()); message.put(MessageInfo.class, boi.getInput().getMessageInfo()); } }
public void handleMessage(NMRMessage message) throws Fault { Exchange ex = message.getExchange(); Endpoint ep = ex.get(Endpoint.class); BindingOperationInfo boi = ex.get(BindingOperationInfo.class); if (boi == null && message.getNmrExchange()!= null && message.getNmrExchange().getOperation() != null) { BindingInfo service = ep.getEndpointInfo().getBinding(); boi = getBindingOperationInfo(service, message.getNmrExchange().getOperation()); if (boi == null) { throw new Fault(new Message("UNKNOWN_OPERATION", BUNDLE, message.getNmrExchange().getOperation().toString())); } ex.put(BindingOperationInfo.class, boi); ex.put(OperationInfo.class, boi.getOperationInfo()); ex.setOneWay(boi.getOperationInfo().isOneWay()); message.put(MessageInfo.class, boi.getInput().getMessageInfo()); } }
Exchange ex = message.getExchange(); ex.put(BindingOperationInfo.class, operation); ex.setOneWay(operation.getOperationInfo().isOneWay());
Exchange ex = message.getExchange(); ex.put(BindingOperationInfo.class, operation); ex.setOneWay(operation.getOperationInfo().isOneWay());
operation.getOperationInfo()); message.getExchange() .setOneWay(operation.getOperationInfo().isOneWay());
public void handleMessage(Message message) { Exchange ex = message.getExchange(); BindingOperationInfo binding = ex.get(BindingOperationInfo.class); //if we get this far, we're going to be outputting some valid content, but we COULD //also be "echoing" some of the content from the input. Thus, we need to //mark it as requiring the input to be cached. if (message.getExchange().get(CACHE_INPUT_PROPERTY) == null) { message.put(CACHE_INPUT_PROPERTY, Boolean.TRUE); } if (null != binding && null != binding.getOperationInfo() && binding.getOperationInfo().isOneWay()) { closeInput(message); return; } Message out = ex.getOutMessage(); if (out != null) { getBackChannelConduit(message); if (binding != null) { out.put(MessageInfo.class, binding.getOperationInfo().getOutput()); out.put(BindingMessageInfo.class, binding.getOutput()); } InterceptorChain outChain = out.getInterceptorChain(); if (outChain == null) { outChain = OutgoingChainInterceptor.getChain(ex, chainCache); out.setInterceptorChain(outChain); } outChain.doIntercept(out); } }
public void handleMessage(Message message) { Exchange ex = message.getExchange(); BindingOperationInfo binding = ex.get(BindingOperationInfo.class); //if we get this far, we're going to be outputting some valid content, but we COULD //also be "echoing" some of the content from the input. Thus, we need to //mark it as requiring the input to be cached. if (message.getExchange().get(CACHE_INPUT_PROPERTY) == null) { message.put(CACHE_INPUT_PROPERTY, Boolean.TRUE); } if (null != binding && null != binding.getOperationInfo() && binding.getOperationInfo().isOneWay()) { closeInput(message); return; } Message out = ex.getOutMessage(); if (out != null) { getBackChannelConduit(message); if (binding != null) { out.put(MessageInfo.class, binding.getOperationInfo().getOutput()); out.put(BindingMessageInfo.class, binding.getOutput()); } InterceptorChain outChain = out.getInterceptorChain(); if (outChain == null) { outChain = OutgoingChainInterceptor.getChain(ex, chainCache); out.setInterceptorChain(outChain); } outChain.doIntercept(out); } }
message.put(CACHE_INPUT_PROPERTY, Boolean.TRUE); if (null != binding && null != binding.getOperationInfo() && binding.getOperationInfo().isOneWay()) { closeInput(message); return;