private BindingOperationInfo getOperationFromContent(Message message) { BindingOperationInfo boi = null; XMLStreamReader xmlReader = message.getContent(XMLStreamReader.class); if (null != xmlReader) { QName qName = xmlReader.getName(); boi = ServiceModelUtil.getOperation(message.getExchange(), qName); } return boi; }
public void handleMessage(Message message) throws Fault { Exchange ex = message.getExchange(); BindingOperationInfo boi = ex.getBindingOperationInfo(); if (Boolean.TRUE.equals(message.get(Message.PARTIAL_RESPONSE_MESSAGE)) || boi == null) { return; Method method = ex.get(Method.class); BindingMessageInfo bmi; MessageInfo wrappedMessageInfo = message.get(MessageInfo.class); MessageInfo messageInfo; if (wrappedMessageInfo == boi.getOperationInfo().getInput()) { message.put(MessageInfo.class, messageInfo); message.put(BindingMessageInfo.class, bmi); ex.put(BindingOperationInfo.class, boi2); Service service = ServiceModelUtil.getService(message.getExchange()); DataBinding dataBinding = service.getDataBinding(); if (dataBinding instanceof WrapperCapableDatabinding) { helper = createWrapperHelper((WrapperCapableDatabinding)dataBinding,
protected void setupBindingOperationInfo(Exchange exch, Object data) { if (exch.getBindingOperationInfo() == null) { //need to know the operation to determine if oneway QName opName = getOpQName(exch, data); if (opName == null) { return; } BindingOperationInfo bop = ServiceModelUtil .getOperationForWrapperElement(exch, opName, false); if (bop == null) { bop = ServiceModelUtil.getOperation(exch, opName); } if (bop != null) { exch.put(BindingOperationInfo.class, bop); if (bop.getOutput() == null) { exch.setOneWay(true); } } } }
public void handleMessage(Message message) throws Fault { String method = (String)message.get(Message.HTTP_REQUEST_METHOD); if (LOG.isLoggable(Level.FINE)) { LOG.fine("Invoking HTTP method " + method); LOG.fine("URIMappingInterceptor get operation: " + opName); BindingOperationInfo op = ServiceModelUtil.getOperation(message.getExchange(), opName); || !opName.equals(op.getName().getLocalPart())) { if (!Boolean.TRUE.equals(message.getContextualProperty(NO_VALIDATE_PARTS))) { throw new Fault(new org.apache.cxf.common.i18n.Message("NO_OPERATION_PATH", LOG, opName, message.get(Message.PATH_INFO))); message.getExchange().put(BindingOperationInfo.class, op); message.getExchange().put(BindingOperationInfo.class, op); MessageContentsList params = getParameters(message, op); message.setContent(List.class, params);
protected <T> DataReader<T> getDataReader(Message message, Class<T> input) { Service service = ServiceModelUtil.getService(message.getExchange()); DataReader<T> dataReader = service.getDataBinding().createReader(input); if (dataReader == null) { throw new Fault(new org.apache.cxf.common.i18n.Message("NO_DATAREADER", BUNDLE, service.getName())); } dataReader.setAttachments(message.getAttachments()); dataReader.setProperty(DataReader.ENDPOINT, message.getExchange().getEndpoint()); dataReader.setProperty(Message.class.getName(), message); setDataReaderValidation(service, message, dataReader); return dataReader; }
public void handleMessage(Message message) { if (isGET(message) && message.getContent(List.class) != null) { LOG.fine("DocLiteralInInterceptor skipped in HTTP GET method"); return; MessageContentsList parameters = new MessageContentsList(); Exchange exchange = message.getExchange(); BindingOperationInfo bop = exchange.getBindingOperationInfo(); Service service = ServiceModelUtil.getService(message.getExchange()); bop = getBindingOperationInfo(xmlReader, exchange, bop, client); boolean forceDocLitBare = false; Endpoint ep = exchange.get(Endpoint.class); ServiceInfo si = ep.getEndpointInfo().getService(); if (bop != null) { //for xml binding or client side msgInfo = bop.getInput(); if (bop.getOutput() == null) { exchange.setOneWay(true);
public void handleMessage(Message message) { if (isGET(message) && message.getContent(List.class) != null) { LOG.fine("DocLiteralInInterceptor skipped in HTTP GET method"); return; MessageContentsList parameters = new MessageContentsList(); Exchange exchange = message.getExchange(); BindingOperationInfo bop = exchange.getBindingOperationInfo(); Service service = ServiceModelUtil.getService(message.getExchange()); bop = getBindingOperationInfo(xmlReader, exchange, bop, client); boolean forceDocLitBare = false; Endpoint ep = exchange.getEndpoint(); ServiceInfo si = ep.getEndpointInfo().getService(); if (bop != null) { //for xml binding or client side msgInfo = bop.getInput(); if (bop.getOutput() == null) { exchange.setOneWay(true);
private synchronized WrapperHelper getWrapperHelper(Message message, MessageInfo messageInfo, MessageInfo wrappedMessageInfo, Class<?> wrapClass, MessagePartInfo messagePartInfo) { WrapperHelper helper = messagePartInfo.getProperty("WRAPPER_CLASS", WrapperHelper.class); if (helper == null) { Service service = ServiceModelUtil.getService(message.getExchange()); DataBinding dataBinding = service.getDataBinding(); if (dataBinding instanceof WrapperCapableDatabinding) { helper = createWrapperHelper((WrapperCapableDatabinding)dataBinding, messageInfo, wrappedMessageInfo, wrapClass); messagePartInfo.setProperty("WRAPPER_CLASS", helper); } } return helper; }
private BindingOperationInfo getOperation(Message message, QName opName) { BindingOperationInfo bop = ServiceModelUtil.getOperation(message.getExchange(), opName); if (bop == null) Endpoint ep = message.getExchange().get(Endpoint.class); if (ep == null)
private BindingOperationInfo getOperation(Message message, QName opName) { BindingOperationInfo bop = ServiceModelUtil.getOperation(message.getExchange(), opName); if (bop == null) { Endpoint ep = message.getExchange().getEndpoint(); if (ep == null) { return null; } BindingInfo service = ep.getEndpointInfo().getBinding(); boolean output = !isRequestor(message); for (BindingOperationInfo info : service.getOperations()) { if (info.getName().getLocalPart().equals(opName.getLocalPart())) { SoapBody body = null; if (output) { body = info.getOutput().getExtensor(SoapBody.class); } else { body = info.getInput().getExtensor(SoapBody.class); } if (body != null && opName.getNamespaceURI().equals(body.getNamespaceURI())) { return info; } } } } return bop; } public void handleMessage(Message message) {
protected BindingOperationInfo getOperation(Message message, QName opName) { BindingOperationInfo op = ServiceModelUtil.getOperation(message .getExchange(), opName); if (op == null) { throw new Fault(new Exception("Unrecognized operation")); } return op; }
/** * Returns a BindingOperationInfo if the operation is indentified as * a wrapped method, return null if it is not a wrapped method * (i.e., it is a bare method) * * @param exchange * @param name * @param client */ protected BindingOperationInfo getBindingOperationInfo(Exchange exchange, QName name, boolean client) { String local = name.getLocalPart(); if (client && local.endsWith("Response")) { local = local.substring(0, local.length() - 8); } BindingOperationInfo bop = ServiceModelUtil.getOperation(exchange, local); if (bop != null) { exchange.put(BindingOperationInfo.class, bop); } return bop; }
BindingOperationInfo bop = exchange.getBindingOperationInfo(); if (null == bop) { return; Service service = ServiceModelUtil.getService(message.getExchange()); for (SoapHeaderInfo header : headers) { MessagePartInfo mpi = header.getPart(); try { if (ServiceUtils.isSchemaValidationEnabled(SchemaValidationType.IN, message)) { Schema schema = EndpointReferenceUtils.getSchema(service.getServiceInfos().get(0), message .getExchange().getBus()); validateHeader(message, mpi, schema);
protected BindingOperationInfo getBindingOperationInfo(Exchange exchange, QName name, boolean client) { BindingOperationInfo bop = ServiceModelUtil.getOperationForWrapperElement(exchange, name, client); if (bop == null) { bop = super.getBindingOperationInfo(exchange, name, client); } if (bop != null) { exchange.put(BindingOperationInfo.class, bop); } return bop; }
public static String getTargetNamespace(Exchange exchange) { //all ServiceInfo's will have the same target namespace return getService(exchange).getServiceInfos().get(0).getTargetNamespace(); }
endpointName = serviceFactory.getEndpointName(); EndpointInfo ei = service.getEndpointInfo(endpointName); ei = ServiceModelUtil.findBestEndpointInfo(serviceFactory.getInterfaceName(), service .getServiceInfos()); ei = ServiceModelUtil.findBestEndpointInfo(serviceFactory.getInterfaceName(), service .getServiceInfos());
public static DataWriter<XMLEventWriter> getDataWriter(CorbaMessage message) { Service service = ServiceModelUtil.getService(message.getExchange()); DataWriter<XMLEventWriter> dataWriter = service.getDataBinding().createWriter(XMLEventWriter.class); if (dataWriter == null) { //throw a fault //throw new Fault(new org.apache.cxf.common.i18n.Message("NO_DATAWRITER", BUNDLE, service // .getName())); } return dataWriter; }
EndpointInfo ei = ServiceModelUtil.findBestEndpointInfo(portTypeName, service.getServiceInfos()); if (ei != null) { portName = ei.getName();
boolean emptyQueries = CollectionUtils.isEmpty(queries.values()); List<String> names = ServiceModelUtil.getOperationInputPartNames(operation.getOperationInfo()); queries = keepInOrder(queries, operation.getOperationInfo(),
public void handleMessage(Message message) throws Fault { String method = (String)message.get(Message.HTTP_REQUEST_METHOD); if (LOG.isLoggable(Level.FINE)) { LOG.fine("Invoking HTTP method " + method); LOG.fine("URIMappingInterceptor get operation: " + opName); BindingOperationInfo op = ServiceModelUtil.getOperation(message.getExchange(), opName); || !opName.equals(op.getName().getLocalPart())) { if (!Boolean.TRUE.equals(message.getContextualProperty(NO_VALIDATE_PARTS))) { throw new Fault(new org.apache.cxf.common.i18n.Message("NO_OPERATION_PATH", LOG, opName, message.get(Message.PATH_INFO))); message.getExchange().put(BindingOperationInfo.class, op); message.getExchange().put(BindingOperationInfo.class, op); MessageContentsList params = getParameters(message, op); message.setContent(List.class, params);