Refine search
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) {
MessageInfo wrappedMsgInfo; if (Boolean.TRUE.equals(message.get(Message.REQUESTOR_ROLE))) { wrappedMsgInfo = newbop.getInput().getMessageInfo(); } else { wrappedMsgInfo = newbop.getOutput().getMessageInfo(); message.put(BindingMessageInfo.class, newbop.getInput()); } else if (messageInfo == bop.getOperationInfo().getOutput()) { message.put(MessageInfo.class, newbop.getOperationInfo().getOutput()); message.put(BindingMessageInfo.class, newbop.getOutput());
inf.setConcreteName(o.getName()); messageParts = o.getInput().getMessageParts(); bop.getInput().setMessageParts(messageParts); } else { messageParts = o.getInput().getMessageParts(); o.getName().getLocalPart() + "Response")); messageParts = o.getOutput().getMessageParts(); bop.getOutput().setMessageParts(messageParts); } else { messageParts = o.getOutput().getMessageParts();
public static Set<QName> getHeaderQNameInOperationParam(SoapMessage soapMessage) { BindingOperationInfo bop = soapMessage.getExchange().getBindingOperationInfo(); if (bop != null) { if (bop.getInput() != null) { return getHeaderParts(bop.getInput()); } if (bop.getOutput() != null) { return getHeaderParts(bop.getOutput()); } } return Collections.emptySet(); } }
public static Set<QName> getHeaderQNameInOperationParam(SoapMessage soapMessage) { BindingOperationInfo bop = soapMessage.getExchange().getBindingOperationInfo(); if (bop != null) { if (bop.getInput() != null) { return getHeaderParts(bop.getInput()); } if (bop.getOutput() != null) { return getHeaderParts(bop.getOutput()); } } return Collections.emptySet(); } }
private void setTypeAttr(XMLStreamWriter xmlWriter, Message message) throws XMLStreamException { BindingOperationInfo wsdlOperation = getOperation(message); BindingMessageInfo wsdlMessage = isRequestor(message) ? wsdlOperation.getInput() : wsdlOperation.getOutput(); String typeNamespace = wsdlMessage.getMessageInfo().getName().getNamespaceURI(); if (typeNamespace == null || typeNamespace.length() == 0) { throw new IllegalArgumentException("messageType namespace is null or empty"); } xmlWriter.writeAttribute(XMLConstants.XMLNS_ATTRIBUTE + ":" + "msg", typeNamespace); String typeLocalName = wsdlMessage.getMessageInfo().getName().getLocalPart(); if (typeLocalName == null || typeLocalName.length() == 0) { throw new IllegalArgumentException("messageType local name is null or empty"); } xmlWriter.writeAttribute("type", "msg" + ":" + typeLocalName); }
if (b.isUnwrappedCapable()) { MessagePartInfo part = null; if (output && b.getOutput() != null && !b.getOutput().getMessageParts().isEmpty()) { part = b.getOutput().getMessageParts().get(0); } else if (!output && !b.getInput().getMessageParts().isEmpty()) { part = b.getInput().getMessageParts().get(0); BindingMessageInfo info = output ? b.getOutput() : b.getInput(); if (info != null && info.getMessageParts().size() == 1) { wrapperMap.put(info.getMessageParts().get(0).getConcreteName(),
private void initializeBindingOperation(SoapBindingInfo bi, BindingOperationInfo boi) { SoapOperationInfo soi = new SoapOperationInfo(); SoapOperation soapOp = SOAPBindingUtil.getSoapOperation(boi.getExtensors(ExtensibilityElement.class)); if (soapOp != null) { String action = soapOp.getSoapActionURI(); if (action == null) { action = ""; } soi.setAction(action); soi.setStyle(soapOp.getStyle()); } boi.addExtensor(soi); if (boi.getInput() != null) { initializeMessage(bi, boi, boi.getInput()); } if (boi.getOutput() != null) { initializeMessage(bi, boi, boi.getOutput()); } }
private void initializeBindingOperation(SoapBindingInfo bi, BindingOperationInfo boi) { SoapOperationInfo soi = new SoapOperationInfo(); SoapOperation soapOp = SOAPBindingUtil.getSoapOperation(boi.getExtensors(ExtensibilityElement.class)); if (soapOp != null) { String action = soapOp.getSoapActionURI(); if (action == null) { action = ""; } soi.setAction(action); soi.setStyle(soapOp.getStyle()); } boi.addExtensor(soi); if (boi.getInput() != null) { initializeMessage(bi, boi, boi.getInput()); } if (boi.getOutput() != null) { initializeMessage(bi, boi, boi.getOutput()); } }
public void handleMessage(Message message) { Exchange exchange = message.getExchange(); BindingOperationInfo operation = exchange.getBindingOperationInfo(); if (operation == null) { return; } MessageContentsList objs = MessageContentsList.getContentsList(message); if (objs == null || objs.isEmpty()) { return; } List<MessagePartInfo> parts = null; BindingMessageInfo bmsg = null; boolean client = isRequestor(message); if (!client) { if (operation.getOutput() != null) { bmsg = operation.getOutput(); parts = bmsg.getMessageParts(); } else { // partial response to oneway return; } } else { bmsg = operation.getInput(); parts = bmsg.getMessageParts(); } writeParts(message, exchange, operation, objs, parts); }
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 String addOperationNode(NSStack nsStack, Message message, XMLStreamWriter xmlWriter, boolean output, BindingOperationInfo boi) throws XMLStreamException { String ns = boi.getName().getNamespaceURI(); SoapBody body = null; if (output) { body = boi.getOutput().getExtensor(SoapBody.class); } else { body = boi.getInput().getExtensor(SoapBody.class); } if (body != null) { final String nsUri = body.getNamespaceURI(); //do it once, as it might internally use reflection... if (!StringUtils.isEmpty(nsUri)) { ns = nsUri; } } nsStack.add(ns); String prefix = nsStack.getPrefix(ns); String name = output ? boi.getName().getLocalPart() + "Response" : boi.getName().getLocalPart(); StaxUtils.writeStartElement(xmlWriter, prefix, name, ns); return ns; }
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) {