Refine search
/** * * @param arg0 * @throws HandlingReportErrors_Exception */ @WebMethod @RequestWrapper(localName = "submitReport", targetNamespace = "http://ws.handling.interfaces.dddsample.citerus.se/", className = "com.aggregator.SubmitReport") @ResponseWrapper(localName = "submitReportResponse", targetNamespace = "http://ws.handling.interfaces.dddsample.citerus.se/", className = "com.aggregator.SubmitReportResponse") public void submitReport( @WebParam(name = "arg0", targetNamespace = "") HandlingReport arg0) throws HandlingReportErrors_Exception ;
@Override public String getResponseWrapperClassName(Method selected) { Method m = getDeclaredMethod(selected); ResponseWrapper rw = m.getAnnotation(ResponseWrapper.class); String clsName = ""; if (rw != null) { clsName = rw.className(); } if (clsName.length() > 0) { return clsName; } return null; } public String getRequestWrapperClassName(Method selected) {
if (webMethod.exclude()) { operationName = getValue(webMethod.operationName(), operationName); operation.setName(operationName); operation.setAction(webMethod.action()); WebResult result = method.getAnnotation(WebResult.class); if (result != null) { if (!"".equals(result.targetNamespace())) ns = result.targetNamespace(); if (!"".equals(result.name())) name = result.name(); String ns = requestWrapper == null ? tns : getValue(requestWrapper.targetNamespace(), tns); String name = requestWrapper == null ? operationName : getValue(requestWrapper.localName(), operationName); String wrapperBeanName = requestWrapper == null ? "" : requestWrapper.className(); if ("".equals(wrapperBeanName)) { wrapperBeanName = CodeGenerationHelper.getPackagePrefix(clazz) + capitalize(method.getName()); ns = responseWrapper == null ? tns : getValue(responseWrapper.targetNamespace(), tns); name = responseWrapper == null ? operationName + "Response" : getValue(responseWrapper.localName(), operationName + "Response"); wrapperBeanName = responseWrapper == null ? "" : responseWrapper.className(); if ("".equals(wrapperBeanName)) { wrapperBeanName =
String reqNS = model.getTargetNameSpace(); if (reqWrapper != null) { reqClassName = reqWrapper.className().length() > 0 ? reqWrapper.className() : reqClassName; reqName = reqWrapper.localName().length() > 0 ? reqWrapper.localName() : reqName; reqNS = reqWrapper.targetNamespace().length() > 0 ? reqWrapper.targetNamespace() : reqNS; } else { String resNS = model.getTargetNameSpace(); if (resWrapper != null) { 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(reqWrapper != null && reqWrapper.className().length()>0){ requestClassName = reqWrapper.className(); }else{ requestClassName = beanPackage + capitalize(method.getName()); if(resWrapper != null && resWrapper.className().length()>0){ responseClassName = resWrapper.className(); }else{ responseClassName = beanPackage + capitalize(method.getName()) + RESPONSE; String reqPartName = "parameters"; if (reqWrapper != null) { if (reqWrapper.targetNamespace().length() > 0) if (!isOneway) { if (resWrapper != null) { if (resWrapper.targetNamespace().length() > 0) resNamespace = resWrapper.targetNamespace(); if (resWrapper.localName().length() > 0) resName = resWrapper.localName(); try { if (resWrapper.partName().length() > 0) resPartName = resWrapper.partName(); } catch (LinkageError e) { if (resultQName.getNamespaceURI().length() == 0 && webResult.header()) {
@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; }
method.getAnnotation(RequestWrapper.class); if (requestWrapper != null) { action = getAction(requestWrapper.targetNamespace(), method, requestWrapper.localName(), false); } else { wmAnnotation.operationName(), false); method.getAnnotation(ResponseWrapper.class); if (responseWrapper != null) { action = getAction(responseWrapper.targetNamespace(), method, responseWrapper.localName(), false); } else { wmAnnotation.operationName(), false);
@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; } }
/** * 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); } }
private boolean isRequestPayload(Object payload) { Method m = getMethod(); RequestWrapper reqWrapper = m.getAnnotation(RequestWrapper.class); ResponseWrapper respWrapper = m.getAnnotation(ResponseWrapper.class); if (reqWrapper != null) { return payload.getClass().getName().equals(reqWrapper.className()); } else if (respWrapper != null) { return !payload.getClass().getName().equals(respWrapper.className()); } return true; }
if (webMessage instanceof RequestWrapper) { javax.xml.ws.RequestWrapper annotation = webMethod.getAnnotation(javax.xml.ws.RequestWrapper.class); if ((annotation != null) && (annotation.targetNamespace() != null) && (!"".equals(annotation.targetNamespace()))) { if (!webMethod.getDeclaringEndpointInterface().getTargetNamespace().equals(annotation.targetNamespace())) { 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 ((annotation != null) && (!"".equals(annotation.targetNamespace()))) { if (!annotation.targetNamespace().equals(webParam.getWebMethod().getDeclaringEndpointInterface().getTargetNamespace())) { result.addError(webParam.getPosition(), "Enunciate doesn't allow declaring a target namespace for a web parameter that is different from the " + "target namespace of the endpoint interface. If you really want to, declare the parameter style BARE and use an xml root element from another " +
public QName getResponseWrapperQName() { if (null != respWrapper) { return new QName(respWrapper.targetNamespace(), respWrapper.localName()); } return SOAPConstants.EMPTY_QNAME; }
private Object buildPayloadFromResponse() { Method m = (Method)msgContext.get(ObjectMessageContext.METHOD_OBJ); // TODO -- add support for 'out' params // if (!Void.TYPE.equals(m.getReturnType())) { ResponseWrapper ann = m.getAnnotation(ResponseWrapper.class); assert ann != null : "ResponseWrapper is null"; WebResult wr = m.getAnnotation(WebResult.class); assert wr != null : "WebResult is null for method " + m; Object returnVal = msgContext.get(ObjectMessageContext.METHOD_RETURN); // if a handler has aborted the processing sequence, the // return type may be null if (returnVal != null) { Object wrapper = createWrapperInstance(ann.className()); setWrapperValue(wrapper, wr.name(), returnVal); return wrapper; } } return null; }
/** * 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 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; }
Name methodName = method.getSimpleName(); String operationName = builder.getOperationName(methodName); operationName = webMethod != null && webMethod.operationName().length() > 0 ? webMethod.operationName() : operationName; String reqName = operationName; String resName = operationName + WebServiceConstants.RESPONSE.getValue(); RequestWrapper reqWrapper = method.getAnnotation(RequestWrapper.class); if (reqWrapper != null) { if (reqWrapper.className().length() > 0) requestClassName = reqWrapper.className(); if (reqWrapper.localName().length() > 0) reqName = reqWrapper.localName(); if (reqWrapper.targetNamespace().length() > 0) ResponseWrapper resWrapper = method.getAnnotation(ResponseWrapper.class); if(resWrapper != null) { if (resWrapper.className().length() > 0) responseClassName = resWrapper.className(); if (resWrapper.localName().length() > 0) resName = resWrapper.localName(); if (resWrapper.targetNamespace().length() > 0) resNamespace = resWrapper.targetNamespace();
if(reqWrapper != null && reqWrapper.className().length()>0){ requestClassName = reqWrapper.className(); }else{ requestClassName = beanPackage + capitalize(method.getName()); if(resWrapper != null && resWrapper.className().length()>0){ responseClassName = resWrapper.className(); }else{ responseClassName = beanPackage + capitalize(method.getName()) + RESPONSE; String reqPartName = "parameters"; if (reqWrapper != null) { if (reqWrapper.targetNamespace().length() > 0) if (!isOneway) { if (resWrapper != null) { if (resWrapper.targetNamespace().length() > 0) resNamespace = resWrapper.targetNamespace(); if (resWrapper.localName().length() > 0) resName = resWrapper.localName(); try { if (resWrapper.partName().length() > 0) resPartName = resWrapper.partName(); } catch (LinkageError e) { if (resultQName.getNamespaceURI().length() == 0 && webResult.header()) {
@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; }
@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; } }
/** * 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); } }