public BindingOperationInfo getBindingOperation(Method method, Endpoint endpoint) { try { method = getImplementationMethod(method); } catch (NoSuchMethodException e) { // ignore } return super.getBindingOperation(method, endpoint); }
private Method getDeclaredMethod(Class<?> endpointClass, Method method) { if (!method.getDeclaringClass().equals(endpointClass)) { try { method = endpointClass.getMethod(method.getName(), method.getParameterTypes()); } catch (SecurityException e) { throw new ServiceConstructionException(e); } catch (NoSuchMethodException e) { return isWebMethod(method) ? method : null; } } return method; }
public void bind(OperationInfo o, Method... methods) { Method [] newMethods = new Method[methods.length]; int i = 0; for (Method m : methods) { try { newMethods[i] = getImplementationMethod(m); i++; } catch (NoSuchMethodException e) { if (m.getName().endsWith("Async") && (Future.class.equals(m.getReturnType()) || Response.class.equals(m.getReturnType()))) { newMethods[i] = m; i++; continue; } Class<?> endpointClass = implInfo.getImplementorClass(); Message msg = new Message("SEI_METHOD_NOT_FOUND", LOG, m.getName(), endpointClass.getName()); throw new ServiceConstructionException(msg, e); } } super.bind(o, newMethods); }
.createBindingInfo(serviceFactory.getService(), bindingID, config); Service service = serviceFactory.getService(); service.getServiceInfos().get(0).addBinding(bindingInfo);
@Override public Boolean isWrapped(Method m) { return getServiceFactory().isWrapped(); }
protected void initializeDefaultInterceptors() { super.initializeDefaultInterceptors(); initializeFaultInterceptors(); }
public DataBinding getDataBinding(boolean create) { if (dataBinding == null && create) { dataBinding = createDefaultDataBinding(); } return dataBinding; } protected DataBinding createDefaultDataBinding() {
public void sendEvent(FactoryBeanListener.Event ev, Object ... args) { for (FactoryBeanListener l : listeners) { l.handleEvent(ev, this, args); } }
private Method getProviderServiceObjectMethod(Method m, Class<?> serviceObjectClass) { if (!Provider.class.isAssignableFrom(serviceObjectClass)) { return m; } Class<?> currentSvcClass = serviceObjectClass; Class<?> genericType = null; while (currentSvcClass != null) { genericType = getProviderGenericType(currentSvcClass); if (genericType != null) { break; } // Check superclass until top currentSvcClass = currentSvcClass.getSuperclass(); } // Should never happens if (genericType == null) { return m; } try { return serviceObjectClass.getMethod("invoke", genericType); } catch (Exception e) { throw new ServiceConstructionException(e); } }
private JaxWsClientEndpointImpl getJaxwsEndpoint(QName portName, AbstractServiceFactoryBean sf, WebServiceFeature...features) { Service service = sf.getService(); EndpointInfo ei = null; if (portName == null) {
@Override public Boolean isWrapped(Method m) { return getServiceFactory().isWrapped(); }
public DataBinding getDataBinding(boolean create) { if (dataBinding == null && create) { dataBinding = createDefaultDataBinding(); } return dataBinding; } protected DataBinding createDefaultDataBinding() {
public JAXWSProviderMethodDispatcher(JaxWsImplementorInfo implInfo) { try { invoke = ReflectionUtil.getMethod(implInfo.getImplementorClass(), "invoke", new Class[] {implInfo.getProviderParameterType()}); ReflectionUtil.setAccessible(invoke); } catch (Exception e1) { //fall back to the raw Provider provided invoke method try { invoke = Provider.class.getMethod("invoke", new Class[] {Object.class}); } catch (Exception e) { throw new ServiceConstructionException(e); } } }
public DataBinding getDataBinding(boolean create) { if (dataBinding == null && create) { dataBinding = createDefaultDataBinding(); } return dataBinding; } protected DataBinding createDefaultDataBinding() {
protected void bindOperation(OperationInfo op, Method method) { try { // Find the Async method which returns a Response Method responseMethod = ReflectionUtil.getDeclaredMethod(method.getDeclaringClass(), method.getName() + "Async", method.getParameterTypes()); // Find the Async method whic has a Future & AsyncResultHandler List<Class<?>> asyncHandlerParams = Arrays.asList(method.getParameterTypes()); //copy it to may it non-readonly asyncHandlerParams = new ArrayList<>(asyncHandlerParams); asyncHandlerParams.add(AsyncHandler.class); Method futureMethod = ReflectionUtil .getDeclaredMethod(method.getDeclaringClass(), method.getName() + "Async", asyncHandlerParams.toArray(new Class<?>[0])); getMethodDispatcher().bind(op, method, responseMethod, futureMethod); } catch (SecurityException e) { throw new ServiceConstructionException(e); } catch (NoSuchMethodException e) { getMethodDispatcher().bind(op, method); } }
@Override protected Class<?> getBeanClass(Class<?> exClass) { try { if (java.rmi.ServerException.class.isAssignableFrom(exClass) || java.rmi.RemoteException.class.isAssignableFrom(exClass) || "javax.xml.ws".equals(PackageUtils.getPackageName(exClass))) { return null; } Method getFaultInfo = exClass.getMethod("getFaultInfo", new Class[0]); return getFaultInfo.getReturnType(); } catch (SecurityException e) { throw new ServiceConstructionException(e); } catch (NoSuchMethodException e) { //ignore for now } WebFault fault = exClass.getAnnotation(WebFault.class); if (fault != null && !StringUtils.isEmpty(fault.faultBean())) { try { return ClassLoaderUtils.loadClass(fault.faultBean(), exClass); } catch (ClassNotFoundException e1) { //ignore } } return super.getBeanClass(exClass); }
@Override public void setServiceClass(Class<?> serviceClass) { if (serviceClass == null) { Message message = new Message("SERVICECLASS_MUST_BE_SET", LOG); throw new ServiceConstructionException(message); } setJaxWsImplementorInfo(new JaxWsImplementorInfo(serviceClass)); super.setServiceClass(getJaxWsImplementorInfo().getEndpointClass()); super.setServiceType(getJaxWsImplementorInfo().getSEIType()); } @Override
protected void initializeWSDLOperationsForProvider() { Class<?> c = getProviderParameterType(getServiceClass()); if (c == null) { throw new ServiceConstructionException(new Message("INVALID_PROVIDER_EXC", LOG)); throw new ServiceConstructionException(e);