@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; }
/** * The local name of the output. * * @return The local name of the output. */ public String getElementName() { String name = webMethod.getOperationName() + "Response"; javax.xml.ws.ResponseWrapper annotation = webMethod.getAnnotation(javax.xml.ws.ResponseWrapper.class); if ((annotation != null) && (annotation.localName() != null) && (!"".equals(annotation.localName()))) { name = annotation.localName(); } return name; }
/** * The local name of the output. * * @return The local name of the output. */ public String getElementName() { String name = webMethod.getSimpleName() + "Response"; javax.xml.ws.ResponseWrapper annotation = webMethod.getAnnotation(javax.xml.ws.ResponseWrapper.class); if ((annotation != null) && (annotation.localName() != null) && (!"".equals(annotation.localName()))) { name = annotation.localName(); } return name; }
/** * The local name of the output. * * @return The local name of the output. */ public String getElementName() { String name = webMethod.getOperationName() + "Response"; javax.xml.ws.ResponseWrapper annotation = webMethod.getAnnotation(javax.xml.ws.ResponseWrapper.class); if ((annotation != null) && (annotation.localName() != null) && (!"".equals(annotation.localName()))) { name = annotation.localName(); } return name; }
public QName getResponseWrapperQName() { if (null != respWrapper) { return new QName(respWrapper.targetNamespace(), respWrapper.localName()); } return SOAPConstants.EMPTY_QNAME; }
@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); } }
/** * 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 getAnnoResponseWrapperLocalName() { if (!isWrappedParameters()) { // A wrapper is only meaningful for wrapped parameters return null; } if (responseWrapperLocalName == null) { if (getAnnoResponseWrapper() != null && !DescriptionUtils.isEmpty(getAnnoResponseWrapper().localName())) { responseWrapperLocalName = getAnnoResponseWrapper().localName(); } else { // The default value of localName is the value of operationQName as // defined in the WebMethod annotation appended with "Response". [JAX-WS Sec. 7.4, p. 81] responseWrapperLocalName = getAnnoWebMethodOperationName() + "Response"; } } return responseWrapperLocalName; }
/** * 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 getAnnoResponseWrapperLocalName() { if (!isWrappedParameters()) { // A wrapper is only meaningful for wrapped parameters return null; } if (responseWrapperLocalName == null) { if (getAnnoResponseWrapper() != null && !DescriptionUtils.isEmpty(getAnnoResponseWrapper().localName())) { responseWrapperLocalName = getAnnoResponseWrapper().localName(); } else { // The default value of localName is the value of operationQName as // defined in the WebMethod annotation appended with "Response". [JAX-WS Sec. 7.4, p. 81] responseWrapperLocalName = getAnnoWebMethodOperationName() + "Response"; } } return responseWrapperLocalName; }
@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; }
action = getAction(responseWrapper.targetNamespace(), method, responseWrapper.localName(), false); } else {
/** * 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); } }