public void marshall(Class parentType, QName elementType, ExtensibilityElement extension, PrintWriter pw, Definition def, ExtensionRegistry extReg) throws WSDLException { HTTPBinding httpBinding = (HTTPBinding)extension; if (httpBinding != null) { String tagName = DOMUtils.getQualifiedValue(HTTPConstants.NS_URI_HTTP, "binding", def); pw.print(" <" + tagName); DOMUtils.printAttribute(HTTPConstants.ATTR_VERB, httpBinding.getVerb(), pw); Boolean required = httpBinding.getRequired(); if (required != null) { DOMUtils.printQualifiedAttribute(Constants.Q_ATTR_REQUIRED, required.toString(), def, pw); } pw.println("/>"); } }
private String getVerb() { ExtensibilityElement extElement = WSDLAwareSOAPProcessor.getBindingExtension(httpBinding); if (extElement instanceof HTTPBinding) { return ((HTTPBinding) extElement).getVerb(); } throw new IllegalArgumentException("Current binding is not a HTTP Binding."); }
/** * ODE extends the wsdl spec by allowing definition of the HTTP verb at the operation level. * <br/>The current implementation implementations allows you to have a {@literal <binding xmlns="http://schemas.xmlsoap.org/wsdl/http/"/>} element * at the port level <strong>and</strong> at the operation level. In such a case the operation's verb overrides the port's verb. * <br/> This method applies the later rule. * <br/> If defined the operation's verb is returned, else the port's verb. * * @param binding * @param bindingOperation * @return If defined the operation's verb is returned, else the port's verb. * @see #getOperationVerb(javax.wsdl.BindingOperation) */ public static String resolveVerb(Binding binding, BindingOperation bindingOperation) { final HTTPBinding httpBinding = (HTTPBinding) WsdlUtils.getBindingExtension(binding); String portVerb = httpBinding != null ? httpBinding.getVerb() : null; String operationVerb = WsdlUtils.getOperationVerb(bindingOperation); return operationVerb != null ? operationVerb : portVerb; }
/** * Retrieves all the operations defined in the provided Binding. * * @param binding WSDL binding * @return a set of {@link WSDLOperation} defined in the provided Binding */ private Set<WSDLOperation> getHttpBindingOperations(Binding binding) { Set<WSDLOperation> allBindingOperations = new HashSet<>(); if (binding.getExtensibilityElements() != null && binding.getExtensibilityElements().size() > 0) { if (binding.getExtensibilityElements().get(0) instanceof HTTPBinding) { HTTPBinding httpBinding = (HTTPBinding) binding.getExtensibilityElements().get(0); String verb = httpBinding.getVerb(); for (Object opObj : binding.getBindingOperations()) { if (opObj instanceof BindingOperation) { BindingOperation bindingOperation = (BindingOperation) opObj; WSDLOperation wsdlOperation = getOperation(bindingOperation, verb); if (wsdlOperation != null) { allBindingOperations.add(wsdlOperation); } } } } } return allBindingOperations; }
/** * Retrieves all the operations defined in the provided Binding. * * @param binding WSDL binding * @return a set of {@link WSDLOperation} defined in the provided Binding */ private Set<WSDLOperation> getHttpBindingOperations(Binding binding) { Set<WSDLOperation> allBindingOperations = new HashSet<>(); if (binding.getExtensibilityElements() != null && binding.getExtensibilityElements().size() > 0) { if (binding.getExtensibilityElements().get(0) instanceof HTTPBinding) { HTTPBinding httpBinding = (HTTPBinding) binding.getExtensibilityElements().get(0); String verb = httpBinding.getVerb(); for (Object opObj : binding.getBindingOperations()) { if (opObj instanceof BindingOperation) { BindingOperation bindingOperation = (BindingOperation) opObj; WSDLOperation wsdlOperation = getOperation(bindingOperation, verb); if (wsdlOperation != null) { allBindingOperations.add(wsdlOperation); } } } } } return allBindingOperations; }
public void marshall(Class parentType, QName elementType, ExtensibilityElement extension, PrintWriter pw, Definition def, ExtensionRegistry extReg) throws WSDLException { HTTPBinding httpBinding = (HTTPBinding)extension; if (httpBinding != null) { String tagName = DOMUtils.getQualifiedValue(HTTPConstants.NS_URI_HTTP, "binding", def); pw.print(" <" + tagName); DOMUtils.printAttribute(HTTPConstants.ATTR_VERB, httpBinding.getVerb(), pw); Boolean required = httpBinding.getRequired(); if (required != null) { DOMUtils.printQualifiedAttribute(Constants.Q_ATTR_REQUIRED, required.toString(), def, pw); } pw.println("/>"); } }
HTTPBinding hb = (HTTPBinding) obj; if (hb.getVerb().equalsIgnoreCase("post")) { bEntry.setBindingType(BindingEntry.TYPE_HTTP_POST); } else {
HTTPBinding hb = (HTTPBinding) obj; if (hb.getVerb().equalsIgnoreCase("post")) { bEntry.setBindingType(BindingEntry.TYPE_HTTP_POST); } else {
if (portElement instanceof HTTPBinding) { HTTPBinding httpBinding = (HTTPBinding) portElement; String verb = httpBinding.getVerb(); if (verb == null || "".equals(verb)) { continue;
HTTPBinding hb = (HTTPBinding) obj; if (hb.getVerb().equalsIgnoreCase("post")) { bEntry.setBindingType(BindingEntry.TYPE_HTTP_POST); } else {
if (portElement instanceof HTTPBinding) { HTTPBinding httpBinding = (HTTPBinding) portElement; String verb = httpBinding.getVerb(); if (verb == null || "".equals(verb)) { continue;
protected AbstractEndpoint createEndpoint(ExtensibilityElement portElement, ExtensibilityElement bindingElement, JbiEndpoint jbiEndpoint) { if (jbiEndpoint == null) { return null; } if (portElement instanceof HTTPAddress && bindingElement instanceof HTTPBinding) { if (!"POST".equals(((HTTPBinding) bindingElement).getVerb())) { throw new UnsupportedOperationException(((HTTPBinding) bindingElement).getVerb() + " not supported"); } HttpEndpoint endpoint = new HttpEndpoint(); endpoint.setSoap(false); endpoint.setRole(jbiEndpoint.getRole()); endpoint.setDefaultMep(jbiEndpoint.getDefaultMep()); endpoint.setDefaultOperation(jbiEndpoint.getDefaultOperation()); endpoint.setLocationURI(((HTTPAddress) portElement).getLocationURI()); return endpoint; } else if (portElement instanceof SOAPAddress && bindingElement instanceof SOAPBinding) { HttpEndpoint endpoint = new HttpEndpoint(); endpoint.setSoap(true); endpoint.setRole(jbiEndpoint.getRole()); endpoint.setDefaultMep(jbiEndpoint.getDefaultMep()); endpoint.setDefaultOperation(jbiEndpoint.getDefaultOperation()); endpoint.setLocationURI(((SOAPAddress) portElement).getLocationURI()); return endpoint; } else { return null; } }
axisBinding.setProperty(WSDL2Constants.ATTR_WHTTP_METHOD, httpBinding.getVerb()); } else if (wsdl4jExtensibilityElement instanceof MIMEContent) { if (description instanceof AxisBindingMessage) {
axisBinding.setProperty(WSDL2Constants.ATTR_WHTTP_METHOD, httpBinding.getVerb()); } else if (wsdl4jExtensibilityElement instanceof MIMEContent) { if (description instanceof AxisBindingMessage) {