@Override public QName getResponseWrapperName(OperationInfo op, Method method) { Method m = getDeclaredMethod(method); ResponseWrapper rw = m.getAnnotation(ResponseWrapper.class); String nm = null; String lp = null; if (rw != null) { nm = rw.targetNamespace(); lp = rw.localName(); } WebMethod meth = m.getAnnotation(WebMethod.class); if (meth != null && StringUtils.isEmpty(lp)) { lp = meth.operationName(); if (!StringUtils.isEmpty(lp)) { lp += "Response"; } } if (StringUtils.isEmpty(nm)) { nm = op.getName().getNamespaceURI(); } if (!StringUtils.isEmpty(nm) && !StringUtils.isEmpty(lp)) { return new QName(nm, lp); } return null; }
public QName getResponseWrapperQName() { if (null != respWrapper) { return new QName(respWrapper.targetNamespace(), respWrapper.localName()); } return SOAPConstants.EMPTY_QNAME; }
/** * The local namespace of the output. * * @return The local namespace of the output. */ public String getElementNamespace() { String namespace = webMethod.getDeclaringEndpointInterface().getTargetNamespace(); javax.xml.ws.ResponseWrapper annotation = webMethod.getAnnotation(javax.xml.ws.ResponseWrapper.class); if ((annotation != null) && (annotation.targetNamespace() != null) && (!"".equals(annotation.targetNamespace()))) { namespace = annotation.targetNamespace(); } return namespace; }
/** * The local namespace of the output. * * @return The local namespace of the output. */ public String getElementNamespace() { String namespace = webMethod.getDeclaringEndpointInterface().getTargetNamespace(); javax.xml.ws.ResponseWrapper annotation = webMethod.getAnnotation(javax.xml.ws.ResponseWrapper.class); if ((annotation != null) && (annotation.targetNamespace() != null) && (!"".equals(annotation.targetNamespace()))) { namespace = annotation.targetNamespace(); } return namespace; }
/** * The local namespace of the output. * * @return The local namespace of the output. */ public String getElementNamespace() { String namespace = webMethod.getDeclaringEndpointInterface().getTargetNamespace(); javax.xml.ws.ResponseWrapper annotation = webMethod.getAnnotation(javax.xml.ws.ResponseWrapper.class); if ((annotation != null) && (annotation.targetNamespace() != null) && (!"".equals(annotation.targetNamespace()))) { namespace = annotation.targetNamespace(); } return namespace; }
@Override protected QName createOutputMessageName(OperationInfo op) { if (op.getMethod().isAnnotationPresent(ResponseWrapper.class)) { ResponseWrapper wrapper = op.getMethod().getAnnotation(ResponseWrapper.class); String ns = wrapper.targetNamespace(); if (ns.length() == 0) ns = op.getService().getPortType().getNamespaceURI(); String name = wrapper.localName(); if (name.length() == 0) name = op.getName(); return new QName(ns, name); } return super.createOutputMessageName(op); } }
@Override public WrapperBeanClass getWrapperBeanClass(final Method method) { javax.xml.ws.ResponseWrapper resWrapper = method.getAnnotation(javax.xml.ws.ResponseWrapper.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 resClassName = getClassName(); String resNs = null; if (resWrapper != null) { resClassName = resWrapper.className().length() > 0 ? resWrapper.className() : resClassName; resNs = resWrapper.targetNamespace().length() > 0 ? resWrapper.targetNamespace() : null; } if (resClassName == null) { resClassName = getPackageName(method) + ".jaxws." + StringUtils.capitalize(methName) + "Response"; } WrapperBeanClass jClass = new WrapperBeanClass(); jClass.setFullClassName(resClassName); jClass.setNamespace(resNs); return jClass; } }
@Override public WrapperBeanClass getWrapperBeanClass(final Method method) { javax.xml.ws.ResponseWrapper resWrapper = method.getAnnotation(javax.xml.ws.ResponseWrapper.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 resClassName = getClassName(); String resNs = null; if (resWrapper != null) { resClassName = resWrapper.className().length() > 0 ? resWrapper.className() : resClassName; resNs = resWrapper.targetNamespace().length() > 0 ? resWrapper.targetNamespace() : null; } if (resClassName == null) { resClassName = getPackageName(method) + ".jaxws." + StringUtils.capitalize(methName) + "Response"; } WrapperBeanClass jClass = new WrapperBeanClass(); jClass.setFullClassName(resClassName); jClass.setNamespace(resNs); return jClass; } }
ResponseWrapper wrapper = method.getAnnotation(ResponseWrapper.class); if (!"".equals(wrapper.targetNamespace())) { namespace = wrapper.targetNamespace();
ResponseWrapper wrapper = method.getAnnotation(ResponseWrapper.class); if (!"".equals(wrapper.targetNamespace())) { namespace = wrapper.targetNamespace();
@Override public QName getResponseWrapperName(OperationInfo op, Method method) { Method m = getDeclaredMethod(method); ResponseWrapper rw = m.getAnnotation(ResponseWrapper.class); String nm = null; String lp = null; if (rw != null) { nm = rw.targetNamespace(); lp = rw.localName(); } WebMethod meth = m.getAnnotation(WebMethod.class); if (meth != null && StringUtils.isEmpty(lp)) { lp = meth.operationName(); if (!StringUtils.isEmpty(lp)) { lp += "Response"; } } if (StringUtils.isEmpty(nm)) { nm = op.getName().getNamespaceURI(); } if (!StringUtils.isEmpty(nm) && !StringUtils.isEmpty(lp)) { return new QName(nm, lp); } return null; }
/** * 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 getAnnoResponseWrapperTargetNamespace() { if (!isWrappedParameters()) { // A wrapper is only meaningful for wrapped parameters return null; } if (responseWrapperTargetNamespace == null) { if (getAnnoResponseWrapper() != null && !DescriptionUtils.isEmpty(getAnnoResponseWrapper().targetNamespace())) { responseWrapperTargetNamespace = getAnnoResponseWrapper().targetNamespace(); } else { // The default value for targetNamespace is the target namespace of the SEI. [JAX-WS Sec 7.3, p. 80] responseWrapperTargetNamespace = getEndpointInterfaceDescription().getTargetNamespace(); } } return responseWrapperTargetNamespace; }
/** * 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 getAnnoResponseWrapperTargetNamespace() { if (!isWrappedParameters()) { // A wrapper is only meaningful for wrapped parameters return null; } if (responseWrapperTargetNamespace == null) { if (getAnnoResponseWrapper() != null && !DescriptionUtils.isEmpty(getAnnoResponseWrapper().targetNamespace())) { responseWrapperTargetNamespace = getAnnoResponseWrapper().targetNamespace(); } else { // The default value for targetNamespace is the target namespace of the SEI. [JAX-WS Sec 7.3, p. 80] responseWrapperTargetNamespace = getEndpointInterfaceDescription().getTargetNamespace(); } } return responseWrapperTargetNamespace; }
method.getAnnotation(ResponseWrapper.class); if (responseWrapper != null) { action = getAction(responseWrapper.targetNamespace(), method, responseWrapper.localName(),
resClassName = resWrapper.className(); resName = resWrapper.localName().length() > 0 ? resWrapper.localName() : resName; resNS = resWrapper.targetNamespace().length() > 0 ? resWrapper.targetNamespace() : resNS; } else { resClassName = model.getPackageName() + ".types."
if ((annotation != null) && (annotation.targetNamespace() != null) && (!"".equals(annotation.targetNamespace()))) { if (!webMethod.getDeclaringEndpointInterface().getTargetNamespace().equals(annotation.targetNamespace())) { result.addError(webMethod.getPosition(), "Enunciate doesn't allow declaring a target namespace for a response wrapper that is " + "different from the target namespace of the endpoint interface. If you really must, declare the parameter style BARE and use an xml root " +
if (resWrapper.localName().length() > 0) resName = resWrapper.localName(); if (resWrapper.targetNamespace().length() > 0) resNamespace = resWrapper.targetNamespace();
if (resWrapper.localName().length() > 0) resName = resWrapper.localName(); if (resWrapper.targetNamespace().length() > 0) resNamespace = resWrapper.targetNamespace();
/** * This method will drive the attachment of @ResponeWrapper annotation data to the * <code>MethodDescriptionComposite</code> * * @param mdc - <code>MethodDescriptionComposite</code> * @param method - <code>Method</code> */ private void attachResponseWrapperAnnotation(MethodDescriptionComposite mdc, Method method) { ResponseWrapper responseWrapper = (ResponseWrapper)ConverterUtils.getAnnotation( ResponseWrapper.class, method); if (responseWrapper != null) { ResponseWrapperAnnot rwAnnot = ResponseWrapperAnnot.createResponseWrapperAnnotImpl(); rwAnnot.setClassName(responseWrapper.className()); rwAnnot.setLocalName(responseWrapper.localName()); rwAnnot.setTargetNamespace(responseWrapper.targetNamespace()); try { rwAnnot.setPartName(responseWrapper.partName()); } catch (NoSuchMethodError ex) { // Ignore: we are running on Java 1.6 and the JAX-WS 2.2 libs have not been endorsed } mdc.setResponseWrapperAnnot(rwAnnot); } }
/** * This method will drive the attachment of @ResponeWrapper annotation data to the * <code>MethodDescriptionComposite</code> * * @param mdc - <code>MethodDescriptionComposite</code> * @param method - <code>Method</code> */ private void attachResponseWrapperAnnotation(MethodDescriptionComposite mdc, Method method) { ResponseWrapper responseWrapper = (ResponseWrapper)ConverterUtils.getAnnotation( ResponseWrapper.class, method); if (responseWrapper != null) { ResponseWrapperAnnot rwAnnot = ResponseWrapperAnnot.createResponseWrapperAnnotImpl(); rwAnnot.setClassName(responseWrapper.className()); rwAnnot.setLocalName(responseWrapper.localName()); rwAnnot.setTargetNamespace(responseWrapper.targetNamespace()); try { rwAnnot.setPartName(responseWrapper.partName()); } catch (NoSuchMethodError ex) { // Ignore: we are running on Java 1.6 and the JAX-WS 2.2 libs have not been endorsed } mdc.setResponseWrapperAnnot(rwAnnot); } }