bindingOperation.setQName(operation.getQName()); bindingOperation.setMEP(SOAPMEPConstants.REQUEST_RESPONSE); } else { bindingOperation.setMEP(SOAPMEPConstants.ONE_WAY); bindingOperation.setSoapAction(operation.getQName().getNamespaceURI() + (operation.getQName().getNamespaceURI().endsWith( "/") ? "" : "/") BindingInput binput = bindingOperation.createInput(); bindingOperation.setInput(binput); BindingOutput boutput = bindingOperation.createOutput(); bindingOperation.setOutput(boutput); BindingFault bfault = bindingOperation.createFault(); bindingOperation.addFault(bfault); bfault.setRef(faultop.getElement().getQName());
private static String getWSDL2Mep(final BindingOperation operation) { final SOAPMEPConstants soapMep = operation.getMEP(); // TODO shoudn't we also look at the WSDL input/output/fault to know the MEP? like robust or in opt out? if (soapMep == SOAPMEPConstants.ONE_WAY) { if (!operation.getFaults().isEmpty()) { return WSDL2Constants.MEP_URI_ROBUST_IN_ONLY; } else { return WSDL2Constants.MEP_URI_IN_ONLY; } } else if (soapMep == SOAPMEPConstants.REQUEST_RESPONSE) { return WSDL2Constants.MEP_URI_IN_OUT; } else { return WSDL2Constants.MEP_URI_OUT_ONLY; } }
if(bOpItem.getQName().getLocalPart().equals(op.getQName().getLocalPart())) { bOp = bOpItem; if(bOp.getStyle() == StyleConstant.DOCUMENT) { this.log.finest("format as document"); formattedMessage = this.formatAsDocument((BPELInternalMessage)variable.getValue(), op, direction); } else if(bOp.getStyle() == StyleConstant.RPC) { this.log.finest("format as rpc"); formattedMessage = this.formatAsRpc((BPELInternalMessage)variable.getValue(), bOp, op, direction);
final QName qName = operation.getQName(); final MEPPatternConstants mep = interfaceType.getOperation(qName).getPattern(); for (final Element e : operation.getOtherElements()) { if (hasQName(e, EL_WSDL_OPERATION)) { if (camelOperation != null) {
private BPELInternalMessage formatAsRpc(final BPELInternalMessage internalMessage, final BindingOperation bOp, final Operation op, final String direction) throws BPELException { final BPELInternalMessage formattedMessage = new BPELInternalMessageImpl(); if(internalMessage != null) { formattedMessage.setEndpoint(internalMessage.getEndpoint()); formattedMessage.setQName(internalMessage.getQName()); formattedMessage.setService(internalMessage.getService()); // change message name by the binding operation name final org.jdom.Element elmt = (org.jdom.Element) internalMessage.getContent().clone(); String operationName = bOp.getQName().getLocalPart(); if(direction.equals(RESPONSE)) { operationName = operationName + "Response"; } elmt.setName(operationName); if(!elmt.getNamespaceURI().equals(bOp.getQName().getNamespaceURI())) { elmt.setNamespace(Namespace.getNamespace(bOp.getQName().getNamespaceURI())); } if(((op.getInput().getParts() != null)&& (op.getInput().getParts().size() > 0)) || op.getInput().getElement() != null) { final org.jdom.Document doc = new org.jdom.Document(elmt); formattedMessage.setContent(doc.getRootElement()); } } else { throw new BPELException("Internal message cannot be null."); } return formattedMessage; }
final Operation operation = bindingOperation.getOperation(); genericOperation.setSoapAction(bindingOperation.getSoapAction()); genericOperation.setMessageExchangePattern(getWSDL2Mep(bindingOperation));
private String retrieveSoapActionFromWsdl(final Exchange exchange, final ServiceContext<Provides> context) { String soapAction = null; final String endpointName = exchange.getEndpointName(); final QName service = exchange.getEndpoint().getServiceName(); final Description d = context.getServiceDescription(); final Endpoint e = d.getService(service).getEndpoint(endpointName); if (e != null) { final Binding b = e.getBinding(); if (b != null) { final BindingOperation bo = b.getBindingOperation(exchange.getOperationName()); if (bo != null) { soapAction = bo.getSoapAction(); // See PETALSBCSOAP-151 if (soapAction == null || soapAction.isEmpty()) { // it must contain the characters for an empty string, if not // org.apache.axis2.transport.http.CommonsHTTPTransportSender.findSOAPAction(MessageContext) // won't be happy with it! soapAction = "\"\""; } } } } return soapAction; } }
bindingOperation.setQName(operation.getQName()); .setSoapAction(operation.getQName().getNamespaceURI() + (operation.getQName().getNamespaceURI().endsWith( "/") ? "" : "/") BindingInput binput = bindingOperation.createInput(); bindingOperation.setInput(binput); SOAP11Binding4Wsdl11 soap11binding = binput.createSOAP11Binding4Wsdl11(); BindingOutput boutput = bindingOperation.createOutput(); bindingOperation.setOutput(boutput); SOAP11Binding4Wsdl11 soap11binding = boutput.createSOAP11Binding4Wsdl11(); BindingFault bfault = bindingOperation.createFault(); try { bfault.setName(faultop.getName()); bindingOperation.addFault(bfault); SOAP11Binding4Wsdl11 soap11binding = bfault.createSOAP11Binding4Wsdl11();