public String getRequestWrapperClassName(Method selected) { Method m = getDeclaredMethod(selected); RequestWrapper rw = m.getAnnotation(RequestWrapper.class); String clsName = ""; if (rw != null) { clsName = rw.className(); } if (clsName.length() > 0) { return clsName; } return null; }
clsName = getPackageName(selected) + ".jaxws." + StringUtils.capitalize(selected.getName()); } else { clsName = rw.className();
public String getRequestWrapperType() { if (null != reqWrapper) { return reqWrapper.className(); } return ""; }
public String getRequestWrapperClassName(Method selected) { Method m = getDeclaredMethod(selected); RequestWrapper rw = m.getAnnotation(RequestWrapper.class); String clsName = ""; if (rw != null) { clsName = rw.className(); } if (clsName.length() > 0) { return clsName; } return null; }
private boolean isRequestPayload(Object payload) { Method m = getMethod(); RequestWrapper reqWrapper = m.getAnnotation(RequestWrapper.class); ResponseWrapper respWrapper = m.getAnnotation(ResponseWrapper.class); if (reqWrapper != null) { return payload.getClass().getName().equals(reqWrapper.className()); } else if (respWrapper != null) { return !payload.getClass().getName().equals(respWrapper.className()); } return true; }
/** * The name of the JAXWS request bean. * * @return The name of the JAXWS request bean. */ public String getRequestBeanName() { String capitalizedName = this.webMethod.getSimpleName().toString(); capitalizedName = Character.toString(capitalizedName.charAt(0)).toUpperCase() + capitalizedName.substring(1); String requestBeanName = this.webMethod.getDeclaringEndpointInterface().getPackage().getQualifiedName() + ".jaxws." + capitalizedName; javax.xml.ws.RequestWrapper annotation = webMethod.getAnnotation(javax.xml.ws.RequestWrapper.class); if ((annotation != null) && (annotation.className() != null) && (!"".equals(annotation.className()))) { requestBeanName = annotation.className(); } return requestBeanName; }
@Override public boolean isWrapperAbsent(final Method method) { javax.xml.ws.RequestWrapper reqWrapper = method.getAnnotation(javax.xml.ws.RequestWrapper.class); return getClassName() == null && (reqWrapper == null || StringUtils.isEmpty(reqWrapper.className())); }
@Override public boolean isWrapperAbsent(final Method method) { javax.xml.ws.RequestWrapper reqWrapper = method.getAnnotation(javax.xml.ws.RequestWrapper.class); return getClassName() == null && (reqWrapper == null || StringUtils.isEmpty(reqWrapper.className())); }
/** * The name of the JAXWS request bean. * * @return The name of the JAXWS request bean. */ public String getRequestBeanName() { String capitalizedName = this.webMethod.getSimpleName(); capitalizedName = Character.toString(capitalizedName.charAt(0)).toUpperCase() + capitalizedName.substring(1); String requestBeanName = this.webMethod.getDeclaringEndpointInterface().getPackage().getQualifiedName() + ".jaxws." + capitalizedName; javax.xml.ws.RequestWrapper annotation = webMethod.getAnnotation(javax.xml.ws.RequestWrapper.class); if ((annotation != null) && (annotation.className() != null) && (!"".equals(annotation.className()))) { requestBeanName = annotation.className(); } return requestBeanName; }
/** * The name of the JAXWS request bean. * * @return The name of the JAXWS request bean. */ public String getRequestBeanName() { String capitalizedName = this.webMethod.getSimpleName(); capitalizedName = Character.toString(capitalizedName.charAt(0)).toUpperCase() + capitalizedName.substring(1); String requestBeanName = this.webMethod.getDeclaringEndpointInterface().getPackage().getQualifiedName() + ".jaxws." + capitalizedName; javax.xml.ws.RequestWrapper annotation = webMethod.getAnnotation(javax.xml.ws.RequestWrapper.class); if ((annotation != null) && (annotation.className() != null) && (!"".equals(annotation.className()))) { requestBeanName = annotation.className(); } return requestBeanName; }
clsName = getPackageName(selected) + ".jaxws." + StringUtils.capitalize(selected.getName()); } else { clsName = rw.className();
/** * For wrapped parameter style (based on the annotation and the WSDL), returns the wrapper * value. For non-wrapped (i.e. bare) parameter style, returns null. * * @return */ public String getAnnoRequestWrapperClassName() { if (!isWrappedParameters()) { // A wrapper is only meaningful for wrapped parameters return null; } if (requestWrapperClassName == null) { if (getAnnoRequestWrapper() != null && !DescriptionUtils.isEmpty(getAnnoRequestWrapper().className())) { requestWrapperClassName = getAnnoRequestWrapper().className(); } else { // There is no default for the RequestWrapper class name. // In such cases the programming layer (JAXWS) may use a programming spec specific // mechanism to find the class, build the class, or operate without the class. requestWrapperClassName = null; } } return requestWrapperClassName; }
@Override public WrapperBeanClass getWrapperBeanClass(final Method method) { javax.xml.ws.RequestWrapper reqWrapper = method.getAnnotation(javax.xml.ws.RequestWrapper.class); javax.jws.WebMethod webMethod = method.getAnnotation(javax.jws.WebMethod.class); String methName = webMethod == null ? null : webMethod.operationName(); if (StringUtils.isEmpty(methName)) { methName = method.getName(); } String reqClassName = getClassName(); String reqNs = null; if (reqWrapper != null) { reqClassName = reqWrapper.className().length() > 0 ? reqWrapper.className() : reqClassName; reqNs = reqWrapper.targetNamespace().length() > 0 ? reqWrapper.targetNamespace() : null; } if (reqClassName == null) { reqClassName = getPackageName(method) + ".jaxws." + StringUtils.capitalize(methName); } WrapperBeanClass jClass = new WrapperBeanClass(); jClass.setFullClassName(reqClassName); jClass.setNamespace(reqNs); return jClass; }
/** * For wrapped parameter style (based on the annotation and the WSDL), returns the wrapper * value. For non-wrapped (i.e. bare) parameter style, returns null. * * @return */ public String getAnnoRequestWrapperClassName() { if (!isWrappedParameters()) { // A wrapper is only meaningful for wrapped parameters return null; } if (requestWrapperClassName == null) { if (getAnnoRequestWrapper() != null && !DescriptionUtils.isEmpty(getAnnoRequestWrapper().className())) { requestWrapperClassName = getAnnoRequestWrapper().className(); } else { // There is no default for the RequestWrapper class name. // In such cases the programming layer (JAXWS) may use a programming spec specific // mechanism to find the class, build the class, or operate without the class. requestWrapperClassName = null; } } return requestWrapperClassName; }
@Override public WrapperBeanClass getWrapperBeanClass(final Method method) { javax.xml.ws.RequestWrapper reqWrapper = method.getAnnotation(javax.xml.ws.RequestWrapper.class); javax.jws.WebMethod webMethod = method.getAnnotation(javax.jws.WebMethod.class); String methName = webMethod == null ? null : webMethod.operationName(); if (StringUtils.isEmpty(methName)) { methName = method.getName(); } String reqClassName = getClassName(); String reqNs = null; if (reqWrapper != null) { reqClassName = reqWrapper.className().length() > 0 ? reqWrapper.className() : reqClassName; reqNs = reqWrapper.targetNamespace().length() > 0 ? reqWrapper.targetNamespace() : null; } if (reqClassName == null) { reqClassName = getPackageName(method) + ".jaxws." + StringUtils.capitalize(methName); } WrapperBeanClass jClass = new WrapperBeanClass(); jClass.setFullClassName(reqClassName); jClass.setNamespace(reqNs); return jClass; }
private Object buildPayloadFromRequest(Object[] args) { RequestWrapper ann = getMethod().getAnnotation(RequestWrapper.class); assert ann != null : "failed to get request wrapper annotation"; Object wrapper = createWrapperInstance(ann.className()); int argIndex = 0; Collection<WebParam> annotations = getWebParamAnnotations(getMethod()); for (WebParam wp : annotations) { setWrapperValue(wrapper, wp.name(), args[argIndex++]); } return wrapper; }
inputClass = ClassLoaderUtils.loadClass(wrapper.className(), getClass()); String[] inputOrder = ((XmlType) inputClass.getAnnotation(XmlType.class)).propOrder(); BeanInfo inputBeanInfo = Introspector.getBeanInfo(inputClass);
/** * This method will drive the attachment of @RequestWrapper annotation data to the * <code>MethodDescriptionComposite</code> * * @param mdc - <code>MethodDescriptionComposite</code> * @param method - <code>Method</code> */ private void attachRequestWrapperAnnotation(MethodDescriptionComposite mdc, Method method) { RequestWrapper requestWrapper = (RequestWrapper)ConverterUtils.getAnnotation( RequestWrapper.class, method); if (requestWrapper != null) { RequestWrapperAnnot rwAnnot = RequestWrapperAnnot.createRequestWrapperAnnotImpl(); rwAnnot.setClassName(requestWrapper.className()); rwAnnot.setLocalName(requestWrapper.localName()); rwAnnot.setTargetNamespace(requestWrapper.targetNamespace()); try { rwAnnot.setPartName(requestWrapper.partName()); } catch (NoSuchMethodError ex) { // Ignore: we are running on Java 1.6 and the JAX-WS 2.2 libs have not been endorsed } mdc.setRequestWrapperAnnot(rwAnnot); } }
/** * This method will drive the attachment of @RequestWrapper annotation data to the * <code>MethodDescriptionComposite</code> * * @param mdc - <code>MethodDescriptionComposite</code> * @param method - <code>Method</code> */ private void attachRequestWrapperAnnotation(MethodDescriptionComposite mdc, Method method) { RequestWrapper requestWrapper = (RequestWrapper)ConverterUtils.getAnnotation( RequestWrapper.class, method); if (requestWrapper != null) { RequestWrapperAnnot rwAnnot = RequestWrapperAnnot.createRequestWrapperAnnotImpl(); rwAnnot.setClassName(requestWrapper.className()); rwAnnot.setLocalName(requestWrapper.localName()); rwAnnot.setTargetNamespace(requestWrapper.targetNamespace()); try { rwAnnot.setPartName(requestWrapper.partName()); } catch (NoSuchMethodError ex) { // Ignore: we are running on Java 1.6 and the JAX-WS 2.2 libs have not been endorsed } mdc.setRequestWrapperAnnot(rwAnnot); } }