BindingOperationInfo bop = exchange.getBindingOperationInfo(); if (bop.isUnwrapped()) { exchange.put(BindingOperationInfo.class, bop.getWrappedOperation()); BindingOperationInfo bop = exchange.getBindingOperationInfo(); if (bop.isUnwrapped()) { exchange.put(BindingOperationInfo.class, bop.getWrappedOperation());
public void handleMessage(SoapMessage message) throws Fault { Exchange ex = message.getExchange(); BindingOperationInfo bop = ex.getBindingOperationInfo(); if (bop == null) { return; } if (bop.isUnwrapped()) { bop = bop.getWrappedOperation(); } boolean client = isRequestor(message); BindingMessageInfo bmi = client ? bop.getInput() : bop.getOutput(); if (bmi == null) { return; } SoapBodyInfo sbi = bmi.getExtensor(SoapBodyInfo.class); if (sbi == null || sbi.getAttachments() == null || sbi.getAttachments().isEmpty()) { Service s = ex.getService(); DataBinding db = s.getDataBinding(); if (db instanceof JAXBDataBinding && hasSwaRef((JAXBDataBinding) db)) { setupAttachmentOutput(message); } return; } processAttachments(message, sbi); } protected void processAttachments(SoapMessage message, SoapBodyInfo sbi) {
bop = bop.getWrappedOperation(); message.getExchange().put(BindingOperationInfo.class, bop);
private BindingOperationInfo getBindingOperationInfo(DepthXMLStreamReader xmlReader, Exchange exchange, BindingOperationInfo bop, boolean client) { //bop might be a unwrapped, wrap it back so that we can get correct info if (bop != null && bop.isUnwrapped()) { bop = bop.getWrappedOperation(); } if (bop == null) { QName startQName = xmlReader == null ? new QName("http://cxf.apache.org/jaxws/provider", "invoke") : xmlReader.getName(); bop = getBindingOperationInfo(exchange, startQName, client); } return bop; }
private BindingOperationInfo getBindingOperationInfo(DepthXMLStreamReader xmlReader, Exchange exchange, BindingOperationInfo bop, boolean client) { //bop might be a unwrapped, wrap it back so that we can get correct info if (bop != null && bop.isUnwrapped()) { bop = bop.getWrappedOperation(); } if (bop == null) { QName startQName = xmlReader == null ? new QName("http://cxf.apache.org/jaxws/provider", "invoke") : xmlReader.getName(); bop = getBindingOperationInfo(exchange, startQName, client); } return bop; }
private BindingOperationInfo getBindingOperationInfo(DepthXMLStreamReader xmlReader, Exchange exchange, BindingOperationInfo bop, boolean client) { //bop might be a unwrapped, wrap it back so that we can get correct info if (bop != null && bop.isUnwrapped()) { bop = bop.getWrappedOperation(); } if (bop == null) { QName startQName = xmlReader == null ? new QName("http://cxf.apache.org/jaxws/provider", "invoke") : xmlReader.getName(); bop = getBindingOperationInfo(exchange, startQName, client); } return bop; }
BindingOperationInfo newbop = bop.getWrappedOperation(); MessageInfo wrappedMsgInfo; if (Boolean.TRUE.equals(message.get(Message.REQUESTOR_ROLE))) {
public static SoapOperationInfo getSoapOperationInfo(BindingOperationInfo bindingOpInfo) { SoapOperationInfo soi = bindingOpInfo.getExtensor(SoapOperationInfo.class); if (soi == null && bindingOpInfo.isUnwrapped()) { soi = bindingOpInfo.getWrappedOperation() .getExtensor(SoapOperationInfo.class); } return soi; }
public static SoapOperationInfo getSoapOperationInfo(BindingOperationInfo bindingOpInfo) { SoapOperationInfo soi = bindingOpInfo.getExtensor(SoapOperationInfo.class); if (soi == null && bindingOpInfo.isUnwrapped()) { soi = bindingOpInfo.getWrappedOperation() .getExtensor(SoapOperationInfo.class); } return soi; }
private void setSoapAction(SoapMessage message) { BindingOperationInfo boi = message.getExchange().getBindingOperationInfo(); // The soap action is set on the wrapped operation. if (boi != null && boi.isUnwrapped()) { boi = boi.getWrappedOperation(); } String action = getSoapAction(message, boi); if (message.getVersion() instanceof Soap11) { Map<String, List<String>> tempReqHeaders = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); Map<String, List<String>> reqHeaders = CastUtils.cast((Map<?, ?>)message.get(Message.PROTOCOL_HEADERS)); if (reqHeaders != null) { tempReqHeaders.putAll(reqHeaders); } if (!tempReqHeaders.containsKey(SoapBindingConstants.SOAP_ACTION)) { tempReqHeaders.put(SoapBindingConstants.SOAP_ACTION, Collections.singletonList(action)); } message.put(Message.PROTOCOL_HEADERS, tempReqHeaders); } else if (message.getVersion() instanceof Soap12 && !"\"\"".equals(action)) { String ct = (String) message.get(Message.CONTENT_TYPE); if (ct.indexOf("action=\"") == -1) { ct = new StringBuilder().append(ct) .append("; action=").append(action).toString(); message.put(Message.CONTENT_TYPE, ct); } } }
private void writeWrapper(Message message, BindingOperationInfo bop, XMLStreamWriter xmlWriter) { if (bop.isUnwrapped()) { MessageInfo messageInfo; if (isRequestor(message)) { messageInfo = bop.getWrappedOperation().getOperationInfo().getInput(); } else { messageInfo = bop.getWrappedOperation().getOperationInfo().getOutput(); } MessagePartInfo outPart = messageInfo.getMessageParts().get(0); QName name = outPart.getConcreteName(); try { String pfx = StaxUtils.getUniquePrefix(xmlWriter, name.getNamespaceURI()); xmlWriter.setPrefix(pfx, name.getNamespaceURI()); xmlWriter.writeStartElement(pfx, name.getLocalPart(), name.getNamespaceURI()); xmlWriter.writeNamespace(pfx, name.getNamespaceURI()); } catch (XMLStreamException e) { throw new Fault(new org.apache.cxf.common.i18n.Message("STAX_WRITE_EXC", BUNDLE), e); } } }
private void resetPartTypes(BindingOperationInfo bop) { if (bop.isUnwrapped()) { bop = bop.getWrappedOperation(); } if (bop.isUnwrappedCapable()) { resetPartTypeClass(bop.getWrappedOperation().getOperationInfo().getInput()); resetPartTypeClass(bop.getWrappedOperation().getOperationInfo().getOutput()); resetPartTypeClass(bop.getWrappedOperation().getInput()); resetPartTypeClass(bop.getWrappedOperation().getOutput()); } resetPartTypeClass(bop.getOperationInfo().getInput()); resetPartTypeClass(bop.getOperationInfo().getOutput()); resetPartTypeClass(bop.getInput()); resetPartTypeClass(bop.getOutput()); }
private BindingFaultInfo mapToWrappedBindingFaultInfo(BindingFaultInfo bfi) { BindingOperationInfo boi = bfi.getBindingOperation(); if (boi != null && boi.isUnwrapped()) { boi = boi.getWrappedOperation(); for (BindingFaultInfo bf2 : boi.getFaults()) { if (bf2.getFaultInfo().getName().equals(bfi.getFaultInfo().getName())) { return bf2; } } } return bfi; } public void setEffectiveServerFaultPolicy(EndpointInfo ei, BindingFaultInfo bfi, EffectivePolicy ep) {
private void resetPartTypes(BindingOperationInfo bop) { if (bop.isUnwrapped()) { bop = bop.getWrappedOperation(); } if (bop.isUnwrappedCapable()) { resetPartTypeClass(bop.getWrappedOperation().getOperationInfo().getInput()); resetPartTypeClass(bop.getWrappedOperation().getOperationInfo().getOutput()); resetPartTypeClass(bop.getWrappedOperation().getInput()); resetPartTypeClass(bop.getWrappedOperation().getOutput()); } else { resetPartTypeClass(bop.getOperationInfo().getInput()); resetPartTypeClass(bop.getOperationInfo().getOutput()); resetPartTypeClass(bop.getInput()); resetPartTypeClass(bop.getOutput()); } }
private BindingFaultInfo mapToWrappedBindingFaultInfo(BindingFaultInfo bfi) { BindingOperationInfo boi = bfi.getBindingOperation(); if (boi != null && boi.isUnwrapped()) { boi = boi.getWrappedOperation(); for (BindingFaultInfo bf2 : boi.getFaults()) { if (bf2.getFaultInfo().getName().equals(bfi.getFaultInfo().getName())) { return bf2; } } } return bfi; } public void setEffectiveServerFaultPolicy(EndpointInfo ei, BindingFaultInfo bfi, EffectivePolicy ep) {
protected MessageContentsList getResponsePayloadList(org.apache.cxf.message.Exchange exchange, List<Source> elements) { BindingOperationInfo boi = exchange.getBindingOperationInfo(); if (boi.isUnwrapped()) { boi = boi.getWrappedOperation(); exchange.put(BindingOperationInfo.class, boi); } MessageContentsList answer = new MessageContentsList(); int i = 0; if (boi.getOutput() != null) { for (MessagePartInfo partInfo : boi.getOutput().getMessageParts()) { if (elements != null && elements.size() > i) { answer.put(partInfo, elements.get(i++)); } } } return answer; }
private BindingOperationInfo prepareBindingOperation(Exchange camelExchange, org.apache.cxf.message.Exchange cxfExchange) { // get binding operation info BindingOperationInfo boi = getBindingOperationInfo(camelExchange); ObjectHelper.notNull(boi, "BindingOperationInfo"); // keep the message wrapper in PAYLOAD mode if (endpoint.getDataFormat() == DataFormat.PAYLOAD && boi.isUnwrapped()) { boi = boi.getWrappedOperation(); cxfExchange.put(BindingOperationInfo.class, boi); } // store the original boi in the exchange camelExchange.setProperty(BindingOperationInfo.class.getName(), boi); LOG.trace("Set exchange property: BindingOperationInfo: {}", boi); // Unwrap boi before passing it to make a client call if (endpoint.getDataFormat() != DataFormat.PAYLOAD && !endpoint.isWrapped() && boi != null) { if (boi.isUnwrappedCapable()) { boi = boi.getUnwrappedOperation(); LOG.trace("Unwrapped BOI {}", boi); } } return boi; }
protected void setExchangeProperties(Exchange exchange, Message m) { exchange.put(Bus.class, bus); exchange.put(Endpoint.class, endpoint); exchange.put(Service.class, endpoint.getService()); exchange.put(Binding.class, endpoint.getBinding()); //Setup the BindingOperationInfo QName opName = (QName) m.get(Message.WSDL_OPERATION); BindingInfo bi = endpoint.getEndpointInfo().getBinding(); BindingOperationInfo boi = bi.getOperation(opName); if (boi != null && boi.isUnwrapped()) { boi = boi.getWrappedOperation(); } exchange.put(BindingOperationInfo.class, boi); }
protected void setExchangeProperties(Exchange exchange, Message m) { exchange.put(Bus.class, bus); exchange.put(Endpoint.class, endpoint); exchange.put(Service.class, endpoint.getService()); exchange.put(Binding.class, endpoint.getBinding()); //Setup the BindingOperationInfo QName opName = (QName) m.get(Message.WSDL_OPERATION); BindingInfo bi = endpoint.getEndpointInfo().getBinding(); BindingOperationInfo boi = bi.getOperation(opName); if (boi != null && boi.isUnwrapped()) { boi = boi.getWrappedOperation(); } exchange.put(BindingOperationInfo.class, boi); }