@Override public Boolean isHeader(Method method, int j) { method = getDeclaredMethod(method); if (j >= 0) { WebParam webParam = getWebParam(method, j); return webParam != null && webParam.header(); } WebResult webResult = getWebResult(method); return webResult != null && webResult.header(); }
&& webResult.header()) { countHeaders++; } else if (method.getReturnType() != Void.TYPE) {
public boolean getAnnoWebResultHeader() { if (!isOperationReturningResult()) { return false; } if (webResultHeader == null) { if (getAnnoWebResult() != null) { // Unlike the elements with a String value, if the annotation is present, exclude will always // return a usable value since it will default to FALSE if the element is not present. webResultHeader = Boolean.valueOf(getAnnoWebResult().header()); } else { webResultHeader = WebResult_Header_DEFAULT; } } return webResultHeader.booleanValue(); }
public boolean getAnnoWebResultHeader() { if (!isOperationReturningResult()) { return false; } if (webResultHeader == null) { if (getAnnoWebResult() != null) { // Unlike the elements with a String value, if the annotation is present, exclude will always // return a usable value since it will default to FALSE if the element is not present. webResultHeader = Boolean.valueOf(getAnnoWebResult().header()); } else { webResultHeader = WebResult_Header_DEFAULT; } } return webResultHeader.booleanValue(); }
public void readWebServicesAnnotations(Method m, Class<?> clazz, List<Intent> requiredIntents) { WebResult webResultAnnotation = m.getAnnotation(WebResult.class); if (webResultAnnotation != null) { if (webResultAnnotation.header()) { // Add SOAP intent Intent intent = policyFactory.createIntent(); intent.setName(Constants.SOAP_INTENT); requiredIntents.add(intent); return; } } Annotation[][] parameterAnnotations = m.getParameterAnnotations(); for ( int i=0; i < parameterAnnotations.length; i++ ) { for ( int j=0; j < parameterAnnotations[i].length; j++) { if ( parameterAnnotations[i][j] instanceof WebParam ) { WebParam webParam = (WebParam)parameterAnnotations[i][j]; if ( webParam.header() ) { // Add SOAP intent Intent intent = policyFactory.createIntent(); intent.setName(Constants.SOAP_INTENT); requiredIntents.add(intent); return; } } } } } public void visitInterface(JavaInterface javaInterface) throws InvalidInterfaceException {
@Override public Boolean isHeader(Method method, int j) { method = getDeclaredMethod(method); if (j >= 0) { WebParam webParam = getWebParam(method, j); return webParam != null && webParam.header(); } WebResult webResult = getWebResult(method); return webResult != null && webResult.header(); }
public void readWebServicesAnnotations(Method m, Class<?> clazz, List<Intent> requiredIntents) { WebResult webResultAnnotation = m.getAnnotation(WebResult.class); if (webResultAnnotation != null) { if (webResultAnnotation.header()) { // Add SOAP intent Intent intent = policyFactory.createIntent(); intent.setName(Constants.SOAP_INTENT); requiredIntents.add(intent); return; } } Annotation[][] parameterAnnotations = m.getParameterAnnotations(); for ( int i=0; i < parameterAnnotations.length; i++ ) { for ( int j=0; j < parameterAnnotations[i].length; j++) { if ( parameterAnnotations[i][j] instanceof WebParam ) { WebParam webParam = (WebParam)parameterAnnotations[i][j]; if ( webParam.header() ) { // Add SOAP intent Intent intent = policyFactory.createIntent(); intent.setName(Constants.SOAP_INTENT); requiredIntents.add(intent); return; } } } } } public void visitInterface(JavaInterface javaInterface) throws InvalidInterfaceException {
/** * create a variable from a method's return which is @WebResult annotated */ public static JavaLanguageVariable createVariableFromMethodReturn(Method method) { WebResult webResultAnnotation = method.getAnnotation(WebResult.class); if (webResultAnnotation == null) { throw new IllegalArgumentException(method.getName() + ": return result is not annotated with " + WebResult.class.getSimpleName()); } JavaLanguageVariable variable = new JavaLanguageVariable(); variable.setType(GenericsUtils.getMethodGenericReturnType(method)); variable.setVariableName(webResultAnnotation.name()); variable.setRequired(true); variable.setHeader(webResultAnnotation.header()); Class<?> resultClass = method.getReturnType(); variable.setMultiOccurs(isClassArrayOrCollection(resultClass)); return variable; }
&& webResult.header()) { countHeaders++; } else if (method.getReturnType() != Void.TYPE) {
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; } }
resultName = webResult.partName().length() > 0 ? webResult.partName() : resultName; resultTNS = webResult.targetNamespace().length() > 0 ? webResult.targetNamespace() : resultTNS; isHeader = webResult.header();
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); }
resultTNS = webResult.targetNamespace().length() > 0 ? webResult.targetNamespace() : resultTNS; webResultHeader = webResult.header();
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; }
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; }
responseNamespace = webResult.targetNamespace(); 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); } }
/** * 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 (isOutBound && callback.getWebResult() != null && !callback.getWebResult().header()) { writer.write(objCtx.getReturn(), callback.getWebResultQName(), xmlNode);
if (isOutBound && callback.getWebResult() != null && callback.getWebResult().header()) { SOAPHeader header = envelope.getHeader(); wroteHeader = true;