@Override public QName getOutPartName(OperationInfo op, Method method, int paramNumber) { method = getDeclaredMethod(method); if (paramNumber >= 0) { return getPartName(op, method, paramNumber, op.getOutput(), "return", false); } WebResult webResult = getWebResult(method); String tns = op.getOutput().getName().getNamespaceURI(); String local = null; if (webResult != null) { if (Boolean.TRUE.equals(isRPC(method)) || isDocumentBare(method)) { local = webResult.partName(); } if (local == null || local.length() == 0) { local = webResult.name(); } } if (local == null || local.length() == 0) { if (Boolean.TRUE.equals(isRPC(method)) || !Boolean.FALSE.equals(isWrapped(method))) { local = "return"; } else { local = getOperationName(op.getInterface(), method).getLocalPart() + "Response"; } } return new QName(tns, local); }
public QName getWebResultQName() { if (null != webResultAnnotation) { if (getSOAPStyle() == Style.DOCUMENT) { if ("".equals(webResultAnnotation.name())) { return new QName(webResultAnnotation.targetNamespace(), "return"); } return new QName(webResultAnnotation.targetNamespace(), webResultAnnotation.name()); } else { return new QName("", webResultAnnotation.partName()); } } return SOAPConstants.EMPTY_QNAME; }
public QName getWebResultQName() { WebResult res = getWebResult(); if (null != res) { if (getSOAPStyle() == Style.DOCUMENT) { if ("".equals(res.name())) { return new QName(res.targetNamespace(), "return"); } return new QName(res.targetNamespace(), res.name()); } else { return new QName("", res.partName()); } } return new QName("", ""); }
public String getAnnoWebResultPartName() { if (!isOperationReturningResult()) { return null; } if (webResultPartName == null) { if (getAnnoWebResult() != null && !DescriptionUtils.isEmpty(getAnnoWebResult().partName())) { webResultPartName = getAnnoWebResult().partName(); } else { // Default is the WebResult.name per JSR-181 MR Sec 4.5.1, pg 23 webResultPartName = getAnnoWebResultName(); } } return webResultPartName; }
QName resultQName = null; if (webResult != null) { resultName = webResult.name().length() > 0 && webResult.partName().length() > 0 ? webResult .partName() : resultName; resultName = webResult.name().length() > 0 ? webResult.name() : resultName; resultName = webResult.partName().length() > 0 ? webResult.partName() : resultName; resultTNS = webResult.targetNamespace().length() > 0 ? webResult.targetNamespace() : resultTNS; isHeader = webResult.header();
public String getAnnoWebResultPartName() { if (!isOperationReturningResult()) { return null; } if (webResultPartName == null) { if (getAnnoWebResult() != null && !DescriptionUtils.isEmpty(getAnnoWebResult().partName())) { webResultPartName = getAnnoWebResult().partName(); } else { // Default is the WebResult.name per JSR-181 MR Sec 4.5.1, pg 23 webResultPartName = getAnnoWebResultName(); } } return webResultPartName; }
@Override public QName getOutPartName(OperationInfo op, Method method, int paramNumber) { method = getDeclaredMethod(method); if (paramNumber >= 0) { return getPartName(op, method, paramNumber, op.getOutput(), "return", false); } WebResult webResult = getWebResult(method); String tns = op.getOutput().getName().getNamespaceURI(); String local = null; if (webResult != null) { if (Boolean.TRUE.equals(isRPC(method)) || isDocumentBare(method)) { local = webResult.partName(); } if (local == null || local.length() == 0) { local = webResult.name(); } } if (local == null || local.length() == 0) { if (Boolean.TRUE.equals(isRPC(method)) || !Boolean.FALSE.equals(isWrapped(method))) { local = "return"; } else { local = getOperationName(op.getInterface(), method).getLocalPart() + "Response"; } } return new QName(tns, local); }
protected WebResult(TypeMirror delegate, WebMethod method) { super(delegate); this.method = method; javax.jws.WebResult annotation = method.getAnnotation(javax.jws.WebResult.class); String name = "return"; if ((annotation != null) && (annotation.name() != null) && (!"".equals(annotation.name()))) { name = annotation.name(); } this.name = name; String targetNamespace = method.getDeclaringEndpointInterface().getTargetNamespace(); if ((annotation != null) && (annotation.targetNamespace() != null) && (!"".equals(annotation.targetNamespace()))) { targetNamespace = annotation.targetNamespace(); } this.targetNamespace = targetNamespace; String partName = "return"; if ((annotation != null) && (!"".equals(annotation.partName()))) { partName = annotation.partName(); } this.partName = partName; this.header = ((annotation != null) && (annotation.header())); this.adapterType = AdapterUtil.findAdapterType(method); }
protected WebResult(TypeMirror delegate, WebMethod method) { super(delegate); this.method = method; this.annotation = method.getAnnotation(javax.jws.WebResult.class); String partName = "return"; if ((this.annotation != null) && (!"".equals(this.annotation.partName()))) { partName = this.annotation.partName(); } this.partName = partName; this.header = ((this.annotation != null) && (this.annotation.header())); this.adapterType = AdapterUtil.findAdapterType(method); String name = "return"; if ((this.annotation != null) && (this.annotation.name() != null) && (!"".equals(this.annotation.name()))) { name = this.annotation.name(); this.elementName = name; } else if (!isHeader() && isImplicitSchemaElement()) { this.elementName = method.getSimpleName() + "Response"; } else if (this.header) { this.elementName = ""; } else { this.elementName = name; } this.name = name; }
public WebResultAnnotation getWebResultAnnotation(Method method) { Annotation[][] annotations = method.getParameterAnnotations(); WebResult webResult = (WebResult) method.getAnnotation(WebResult.class); if (webResult != null) { WebResultAnnotation annot = new WebResultAnnotation(); annot.setName(webResult.name()); annot.setTargetNamespace(webResult.targetNamespace()); annot.setHeader(webResult.header()); annot.setPartName(webResult.partName()); return annot; } else { return null; } }
protected WebResult(TypeMirror delegate, WebMethod method, EnunciateJaxwsContext context) { super(delegate, context.getContext().getProcessingEnvironment()); this.context = context; this.method = method; this.annotation = method.getAnnotation(javax.jws.WebResult.class); String partName = "return"; if ((this.annotation != null) && (!"".equals(this.annotation.partName()))) { partName = this.annotation.partName(); } this.partName = partName; this.header = ((this.annotation != null) && (this.annotation.header())); this.adapterType = JAXBUtil.findAdapterType(method, context.getJaxbContext()); String name = "return"; if ((this.annotation != null) && (this.annotation.name() != null) && (!"".equals(this.annotation.name()))) { name = this.annotation.name(); this.elementName = name; } else if (!isHeader() && isImplicitSchemaElement()) { this.elementName = method.getSimpleName() + "Response"; } else if (this.header) { this.elementName = ""; } else { this.elementName = name; } this.name = name; }
/** * This method will drive the attachment of @WebResult annotation data to the * <code>MethodDescriptionComposite</code> * * @param mdc - <code>MethodDescriptionComposite</code> * @param method - <code>Method</code> */ private void attachWebResultAnnotation(MethodDescriptionComposite mdc, Method method) { WebResult webResult = (WebResult)ConverterUtils.getAnnotation(WebResult.class, method); if (webResult != null) { WebResultAnnot wrAnnot = WebResultAnnot.createWebResultAnnotImpl(); wrAnnot.setHeader(webResult.header()); wrAnnot.setName(webResult.name()); wrAnnot.setPartName(webResult.partName()); wrAnnot.setTargetNamespace(webResult.targetNamespace()); mdc.setWebResultAnnot(wrAnnot); } }
if (webResult.targetNamespace().length() > 0) resultTNS = webResult.targetNamespace(); resultPartName = webResult.partName(); isResultHeader = webResult.header();
if (webResult.targetNamespace().length() > 0) resultTNS = webResult.targetNamespace(); resultPartName = webResult.partName(); isResultHeader = webResult.header();
if (webResult.targetNamespace().length() > 0) resultTNS = webResult.targetNamespace(); resultPartName = webResult.partName(); isResultHeader = webResult.header();
/** * This method will drive the attachment of @WebResult annotation data to the * <code>MethodDescriptionComposite</code> * * @param mdc - <code>MethodDescriptionComposite</code> * @param method - <code>Method</code> */ private void attachWebResultAnnotation(MethodDescriptionComposite mdc, Method method) { WebResult webResult = (WebResult)ConverterUtils.getAnnotation(WebResult.class, method); if (webResult != null) { WebResultAnnot wrAnnot = WebResultAnnot.createWebResultAnnotImpl(); wrAnnot.setHeader(webResult.header()); wrAnnot.setName(webResult.name()); wrAnnot.setPartName(webResult.partName()); wrAnnot.setTargetNamespace(webResult.targetNamespace()); mdc.setWebResultAnnot(wrAnnot); } }