public Boolean isWrapperPartQualified(MessagePartInfo mpi) { Annotation[] annotations = (Annotation[])mpi.getProperty("parameter.annotations"); if (annotations != null) { for (Annotation an : annotations) { String tns = null; if (an instanceof WebParam) { tns = ((WebParam)an).targetNamespace(); } else if (an instanceof WebResult) { tns = ((WebResult)an).targetNamespace(); } if (tns != null && !StringUtils.isEmpty(tns)) { return Boolean.TRUE; } } } return null; }
String local = null; if (param != null) { tns = param.targetNamespace(); local = param.name();
/** * The target namespace of this web param. * * @return The target namespace of this web param. */ public String getTargetNamespace() { String namespace = isImplicitSchemaElement() ? method.getDeclaringEndpointInterface().getTargetNamespace() : ""; if ((annotation != null) && (annotation.targetNamespace() != null) && (!"".equals(annotation.targetNamespace()))) { namespace = annotation.targetNamespace(); } return namespace; }
/** * The target namespace of this web param. * * @return The target namespace of this web param. */ public String getTargetNamespace() { String namespace = isImplicitSchemaElement() ? method.getDeclaringEndpointInterface().getTargetNamespace() : ""; if ((annotation != null) && (annotation.targetNamespace() != null) && (!"".equals(annotation.targetNamespace()))) { namespace = annotation.targetNamespace(); } return namespace; }
private boolean isMethodMatch(Node node, WebParam param) { boolean found = false; String nNS = node.getNamespaceURI(); if (nNS != null) { if (param.name().equals(node.getLocalName()) && nNS.equals(param.targetNamespace())) { found = true; } } else if (param.name().equals(node.getLocalName())) { found = true; } return found; }
public Boolean isWrapperPartQualified(MessagePartInfo mpi) { Annotation[] annotations = (Annotation[])mpi.getProperty("parameter.annotations"); if (annotations != null) { for (Annotation an : annotations) { String tns = null; if (an instanceof WebParam) { tns = ((WebParam)an).targetNamespace(); } else if (an instanceof WebResult) { tns = ((WebResult)an).targetNamespace(); } if (tns != null && !StringUtils.isEmpty(tns)) { return Boolean.TRUE; } } } return null; }
if (webParam != null && webParam.targetNamespace().length() > 0) { webParamNS = webParam.targetNamespace();
protected List<JavaField> buildFields(final Method method, final MessageInfo message) { List<JavaField> fields = new ArrayList<>(); final Type[] paramClasses = method.getGenericParameterTypes(); final Annotation[][] paramAnnotations = method.getParameterAnnotations(); for (MessagePartInfo mpi : message.getMessageParts()) { int idx = mpi.getIndex(); String name = mpi.getName().getLocalPart(); Type t = paramClasses[idx]; String type = getTypeString(t); JavaField field = new JavaField(name, type, ""); if (paramAnnotations != null && paramAnnotations.length == paramClasses.length) { WebParam wParam = getWebParamAnnotation(paramAnnotations[idx]); if (wParam != null && !StringUtils.isEmpty(wParam.targetNamespace())) { field.setTargetNamespace(wParam.targetNamespace()); } else { field.setTargetNamespace(""); } } List<Annotation> jaxbAnns = WrapperUtil.getJaxbAnnotations(method, idx); field.setJaxbAnnotations(jaxbAnns.toArray(new Annotation[0])); fields.add(field); } return fields; }
protected List<JavaField> buildFields(final Method method, final MessageInfo message) { List<JavaField> fields = new ArrayList<>(); final Type[] paramClasses = method.getGenericParameterTypes(); final Annotation[][] paramAnnotations = method.getParameterAnnotations(); for (MessagePartInfo mpi : message.getMessageParts()) { int idx = mpi.getIndex(); String name = mpi.getName().getLocalPart(); Type t = paramClasses[idx]; String type = getTypeString(t); JavaField field = new JavaField(name, type, ""); if (paramAnnotations != null && paramAnnotations.length == paramClasses.length) { WebParam wParam = getWebParamAnnotation(paramAnnotations[idx]); if (wParam != null && !StringUtils.isEmpty(wParam.targetNamespace())) { field.setTargetNamespace(wParam.targetNamespace()); } else { field.setTargetNamespace(""); } } List<Annotation> jaxbAnns = WrapperUtil.getJaxbAnnotations(method, idx); field.setJaxbAnnotations(jaxbAnns.toArray(new Annotation[0])); fields.add(field); } return fields; }
Annotation[][] paramAnnotations = method.getParameterAnnotations(); WebParam wParam = getWebParamAnnotation(paramAnnotations[idx]); if (wParam != null && !StringUtils.isEmpty(wParam.targetNamespace())) { jf.setTargetNamespace(wParam.targetNamespace());
String local = null; if (param != null) { tns = param.targetNamespace(); local = param.name();
protected void introspectAnnotations(Annotation[] annotations, DataType targetDataType) { WebResult result = getAnnotation(annotations, WebResult.class); if (result != null) { QName name = new QName(result.targetNamespace(), result.name()); targetDataType.setLogical(new XMLType(name, null)); } WebParam param = getAnnotation(annotations, WebParam.class); if (param != null) { QName name = new QName(param.targetNamespace(), param.name()); targetDataType.setLogical(new XMLType(name, null)); } }
paraName = webParam.name().length() > 0 ? webParam.name() : paraName; partName = webParam.partName().length() > 0 ? webParam.partName() : paraName; paraTNS = webParam.targetNamespace().length() > 0 ? webParam.targetNamespace() : paraTNS;
String paramName = (webParam != null && webParam.name().length() > 0) ? webParam.name() : "arg"+paramIndex; String paramNamespace = (webParam != null && webParam.targetNamespace().length() > 0) ? webParam.targetNamespace() : EMTPY_NAMESPACE_ID;
String paramName = (webParam != null && webParam.name().length() > 0) ? webParam.name() : "arg"+paramIndex; String paramNamespace = (webParam != null && webParam.targetNamespace().length() > 0) ? webParam.targetNamespace() : EMTPY_NAMESPACE_ID;
@Test public void testAnnotation() throws Exception { Class<PutLastTradedPricePortType> claz = PutLastTradedPricePortType.class; TradePriceData priceData = new TradePriceData(); Holder<TradePriceData> holder = new Holder<>(priceData); Method method = claz.getMethod("sayHi", holder.getClass()); assertNotNull("Can not find SayHi method in generated class ", method); Annotation ann = method.getAnnotation(WebMethod.class); WebMethod webMethod = (WebMethod)ann; assertEquals(webMethod.operationName(), "SayHi"); Annotation[][] paraAnns = method.getParameterAnnotations(); for (Annotation[] paraType : paraAnns) { for (Annotation an : paraType) { if (an.annotationType() == WebParam.class) { WebParam webParam = (WebParam)an; assertNotSame("", webParam.targetNamespace()); } } } }
public String getAnnoWebParamTargetNamespace() { if (webParamTargetNamespace == null) { if (getAnnoWebParam() != null && !DescriptionUtils.isEmpty(getAnnoWebParam().targetNamespace())) { webParamTargetNamespace = getAnnoWebParam().targetNamespace(); } else if (getOperationDescription().getSoapBindingStyle() == SOAPBinding.Style.DOCUMENT && getOperationDescription().getSoapBindingParameterStyle() == SOAPBinding.ParameterStyle.WRAPPED && !getAnnoWebParamHeader()) { // Defaul per JSR-181 MR Sec 4.4.1, pg 20 webParamTargetNamespace = WebParam_TargetNamespace_DEFAULT; } else { // Default per JSR-181 MR Sec 4.4.1, pg 20 webParamTargetNamespace = ((EndpointDescriptionJava)getOperationDescription() .getEndpointInterfaceDescription().getEndpointDescription()) .getAnnoWebServiceTargetNamespace(); } } return webParamTargetNamespace; }
public String getAnnoWebParamTargetNamespace() { if (webParamTargetNamespace == null) { if (getAnnoWebParam() != null && !DescriptionUtils.isEmpty(getAnnoWebParam().targetNamespace())) { webParamTargetNamespace = getAnnoWebParam().targetNamespace(); } else if (getOperationDescription().getSoapBindingStyle() == SOAPBinding.Style.DOCUMENT && getOperationDescription().getSoapBindingParameterStyle() == SOAPBinding.ParameterStyle.WRAPPED && !getAnnoWebParamHeader()) { // Defaul per JSR-181 MR Sec 4.4.1, pg 20 webParamTargetNamespace = WebParam_TargetNamespace_DEFAULT; } else { // Default per JSR-181 MR Sec 4.4.1, pg 20 webParamTargetNamespace = ((EndpointDescriptionJava)getOperationDescription() .getEndpointInterfaceDescription().getEndpointDescription()) .getAnnoWebServiceTargetNamespace(); } } return webParamTargetNamespace; }
/** * This method will attach @WebParam annotation data to the <code> ParameterDescriptionComposite</code> * if the annotation was found on the parameter represented by this index in the parameter list. * * @param pdc - <code>ParameterDescriptionComposite</code> * @param order - the current index in the parameter list */ private void attachWebParamAnnotation(ParameterDescriptionComposite pdc, int order) { Annotation[] orderAnnots = paramAnnotations[order]; for (Annotation annot : orderAnnots) { if (annot instanceof WebParam) { WebParam webParam = (WebParam)annot; WebParamAnnot wpAnnot = WebParamAnnot.createWebParamAnnotImpl(); wpAnnot.setHeader(webParam.header()); wpAnnot.setMode(webParam.mode()); wpAnnot.setName(webParam.name()); wpAnnot.setPartName(webParam.partName()); wpAnnot.setTargetNamespace(webParam.targetNamespace()); pdc.setWebParamAnnot(wpAnnot); } } } }
/** * This method will attach @WebParam annotation data to the <code> ParameterDescriptionComposite</code> * if the annotation was found on the parameter represented by this index in the parameter list. * * @param pdc - <code>ParameterDescriptionComposite</code> * @param order - the current index in the parameter list */ private void attachWebParamAnnotation(ParameterDescriptionComposite pdc, int order) { Annotation[] orderAnnots = paramAnnotations[order]; for (Annotation annot : orderAnnots) { if (annot instanceof WebParam) { WebParam webParam = (WebParam)annot; WebParamAnnot wpAnnot = WebParamAnnot.createWebParamAnnotImpl(); wpAnnot.setHeader(webParam.header()); wpAnnot.setMode(webParam.mode()); wpAnnot.setName(webParam.name()); wpAnnot.setPartName(webParam.partName()); wpAnnot.setTargetNamespace(webParam.targetNamespace()); pdc.setWebParamAnnot(wpAnnot); } } } }