/** * 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; } } }
/** * 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 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();
Binding binding = null; for(final Binding bindingItem: (this.desc).getBindings()) { if((bindingItem.getInterface() != null) && bindingItem.getInterface().getQName().equals(itf.getQName())) { binding = bindingItem; break;
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");
final InterfaceType interfaceType = binding.getInterface(); if (interfaceType == null) { throw new InvalidJBIConfigurationException("No interface defined for the binding of ednpoint '"