/** * TODO Copied from ServiceEndpointHelper from petals-message-exchange, it should be moved to easywsdl normally! */ private static @Nullable InterfaceType getInterfaceFromService(final QName serviceName, final String endpointName, final Description description, final Logger logger) throws WSDLException { final Service ss = description.getService(serviceName); if (ss != null) { final Endpoint endpoint = ss.getEndpoint(endpointName); if (endpoint != null) { final Binding binding = endpoint.getBinding(); if (binding != null && binding.getInterface() != null) { return binding.getInterface(); } else { logger.config("No valid binding for endpoint '" + endpointName + "' in component description for service '" + serviceName + "', using service's interface"); return ss.getInterface(); } } else { logger.config("No endpoint '" + endpointName + "' in component description for service '" + serviceName + "', using service's interface"); return ss.getInterface(); } } else { logger.config("No service '" + serviceName + "' in component description"); return null; } } }
public Binding createDefaultSoapBinding(String bindingName, Endpoint endpoint, InterfaceType itf) { binding.setQName(new QName(((AbstractInterfaceTypeImpl) itf).getDescription().getTargetNamespace(), bindingName)); binding.setInterface(itf); try { binding.setTransportProtocol(Constants.HTTP_WWW_W3_ORG_2003_05_SOAP_BINDINGS_HTTP); } catch (WSDLException e) { BindingOperation bindingOperation = binding.createBindingOperation(); bindingOperation.setQName(operation.getQName()); binding.addBindingOperation(bindingOperation);
Binding binding = null; for(final Binding bindingItem: (this.desc).getBindings()) { if((bindingItem.getInterface() != null) && bindingItem.getInterface().getQName().equals(itf.getQName())) { binding = bindingItem; break; for(final BindingOperation bOpItem: binding.getBindingOperations()) { if(bOpItem.getQName().getLocalPart().equals(op.getQName().getLocalPart())) { bOp = bOpItem;
for (final BindingOperation bindingOperation : binding.getBindingOperations()) { final Operation operation = bindingOperation.getOperation();
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; } }
final InterfaceType interfaceType = binding.getInterface(); if (interfaceType == null) { throw new InvalidJBIConfigurationException("No interface defined for the binding of ednpoint '" for (final BindingOperation operation : binding.getBindingOperations()) { final QName qName = operation.getQName(); final MEPPatternConstants mep = interfaceType.getOperation(qName).getPattern();
/** * in WSDL2, the service has an interface defined, but in WSDL1, we are not totally assured that getting interface * on the service will succeed, so it is safer to check directly the binding. We fallback on the service's interface * else. */ private static InterfaceType getInterfaceFromService(final QName serviceName, final String endpointName, final Description description, final Logger logger) throws WSDLException { final Service ss = description.getService(serviceName); if (ss != null) { final Endpoint endpoint = ss.getEndpoint(endpointName); if (endpoint != null) { final Binding binding = endpoint.getBinding(); if (binding != null && binding.getInterface() != null) { return binding.getInterface(); } else { logger.config("No valid binding for endpoint '" + endpointName + "' in component description for service '" + serviceName + "', using service's interface"); return ss.getInterface(); } } else { logger.config("No endpoint '" + endpointName + "' in component description for service '" + serviceName + "', using service's interface"); return ss.getInterface(); } } else { logger.config("No service '" + serviceName + "' in component description"); return null; } }
public Binding createDefaultSoapBinding(String bindingName, Endpoint endpoint, InterfaceType itf) { binding.setQName(new QName(((AbstractInterfaceTypeImpl) itf).getDescription().getTargetNamespace(), bindingName)); binding.setInterface(itf); try { binding.setTransportProtocol(org.ow2.easywsdl.wsdl.impl.wsdl11.Constants.HTTP_SCHEMAS_XMLSOAP_ORG_SOAP_HTTP); } catch (WSDLException e) { BindingOperation bindingOperation = binding.createBindingOperation(); bindingOperation.setQName(operation.getQName()); binding.addBindingOperation(bindingOperation);
public InterfaceType getInterface() throws WSDLException { InterfaceType res = null; InterfaceType item = null; for (final Endpoint ep : this.getEndpoints()) { item = ep.getBinding().getInterface(); if (item != null) { res = item; } if (item != res) { throw new WSDLException("The endpoints of this service do not implement the same interface"); } } return res; }
/** * Get the endpoints of a given WSDL Description * * @param description * @return */ public static final List<ServiceEndpoint> getEndpoints(Description description) { List<ServiceEndpoint> result = new ArrayList<ServiceEndpoint>(); List<Service> services = description.getServices(); for (Service service : services) { QName serviceName = service.getQName(); List<Endpoint> endpoints = service.getEndpoints(); for (Endpoint endpoint : endpoints) { ServiceEndpoint serviceEndpoint = new ServiceEndpoint(); serviceEndpoint.setEndpoint(endpoint.getName()); serviceEndpoint.setItf(new QName(endpoint.getBinding().getInterface().getQName() .getNamespaceURI(), endpoint.getBinding().getInterface().getQName() .getLocalPart())); serviceEndpoint.setService(new QName(serviceName.getNamespaceURI(), serviceName .getLocalPart())); result.add(serviceEndpoint); } } return result; }
endpointIndex = endpointIndex + 1; List<Operation> operations = binding.getInterface().getOperations(); for (Operation operation : operations) { String operationName = operation.getQName().getLocalPart();
final InterfaceType itf = endpoint.getBinding().getInterface(); final Operation op = itf.getOperation(new QName(itf.getQName().getNamespaceURI(), message.getOperationName())); if(op == null) {
final InterfaceType itf = binding.getInterface(); if(itf == null) { throw new WSDMException("Interface not found");