/** Supports methods with @XPathParam parameters, and return either <code>Source</code> or nothing. */ protected boolean supportsInternal(MethodEndpoint methodEndpoint) { Method method = methodEndpoint.getMethod(); if (!(Source.class.isAssignableFrom(method.getReturnType()) || Void.TYPE.equals(method.getReturnType()))) { return false; } Class<?>[] parameterTypes = method.getParameterTypes(); for (int i = 0; i < parameterTypes.length; i++) { if (getXPathParamAnnotation(method, i) == null || !isSupportedType(parameterTypes[i])) { return false; } } return true; }
/** * Returns the root element of the given source. * * @param source the source to get the root element from * @return the root element */ private Element getRootElement(Source source) throws TransformerException { DOMResult domResult = new DOMResult(); transform(source, domResult); Document document = (Document) domResult.getNode(); return document.getDocumentElement(); }
@Override protected void invokeInternal(MessageContext messageContext, MethodEndpoint methodEndpoint) throws Exception { Element payloadElement = getRootElement(messageContext.getRequest().getPayloadSource()); Object[] args = getMethodArguments(payloadElement, methodEndpoint.getMethod()); Object result = methodEndpoint.invoke(args); if (result != null && result instanceof Source) { Source responseSource = (Source) result; WebServiceMessage response = messageContext.getResponse(); transform(responseSource, response.getPayloadResult()); } }
private Object[] getMethodArguments(Element payloadElement, Method method) throws XPathExpressionException { Class<?>[] parameterTypes = method.getParameterTypes(); XPath xpath = createXPath(); Object[] args = new Object[parameterTypes.length]; for (int i = 0; i < parameterTypes.length; i++) { String expression = getXPathParamAnnotation(method, i).value(); QName conversionType; if (Boolean.class.isAssignableFrom(parameterTypes[i]) || Boolean.TYPE.isAssignableFrom(parameterTypes[i])) {
@Override protected void invokeInternal(MessageContext messageContext, MethodEndpoint methodEndpoint) throws Exception { Element payloadElement = getRootElement(messageContext.getRequest().getPayloadSource()); Object[] args = getMethodArguments(payloadElement, methodEndpoint.getMethod()); Object result = methodEndpoint.invoke(args); if (result != null && result instanceof Source) { Source responseSource = (Source) result; WebServiceMessage response = messageContext.getResponse(); transform(responseSource, response.getPayloadResult()); } }
private Object[] getMethodArguments(Element payloadElement, Method method) throws XPathExpressionException { Class<?>[] parameterTypes = method.getParameterTypes(); XPath xpath = createXPath(); Object[] args = new Object[parameterTypes.length]; for (int i = 0; i < parameterTypes.length; i++) { String expression = getXPathParamAnnotation(method, i).value(); QName conversionType; if (Boolean.class.isAssignableFrom(parameterTypes[i]) || Boolean.TYPE.isAssignableFrom(parameterTypes[i])) {
@Override protected void invokeInternal(MessageContext messageContext, MethodEndpoint methodEndpoint) throws Exception { Element payloadElement = getRootElement(messageContext.getRequest().getPayloadSource()); Object[] args = getMethodArguments(payloadElement, methodEndpoint.getMethod()); Object result = methodEndpoint.invoke(args); if (result != null && result instanceof Source) { Source responseSource = (Source) result; WebServiceMessage response = messageContext.getResponse(); transform(responseSource, response.getPayloadResult()); } }
/** Supports methods with @XPathParam parameters, and return either {@code Source} or nothing. */ @Override protected boolean supportsInternal(MethodEndpoint methodEndpoint) { Method method = methodEndpoint.getMethod(); if (!(Source.class.isAssignableFrom(method.getReturnType()) || Void.TYPE.equals(method.getReturnType()))) { return false; } Class<?>[] parameterTypes = method.getParameterTypes(); for (int i = 0; i < parameterTypes.length; i++) { if (getXPathParamAnnotation(method, i) == null || !isSupportedType(parameterTypes[i])) { return false; } } return true; }
private Object[] getMethodArguments(Element payloadElement, Method method) throws XPathExpressionException { Class<?>[] parameterTypes = method.getParameterTypes(); XPath xpath = createXPath(); Object[] args = new Object[parameterTypes.length]; for (int i = 0; i < parameterTypes.length; i++) { String expression = getXPathParamAnnotation(method, i).value(); QName conversionType; if (Boolean.class.isAssignableFrom(parameterTypes[i]) || Boolean.TYPE.isAssignableFrom(parameterTypes[i])) {
/** * Returns the root element of the given source. * * @param source the source to get the root element from * @return the root element */ private Element getRootElement(Source source) throws TransformerException { DOMResult domResult = new DOMResult(); transform(source, domResult); Document document = (Document) domResult.getNode(); return document.getDocumentElement(); }
protected void invokeInternal(MessageContext messageContext, MethodEndpoint methodEndpoint) throws Exception { Element payloadElement = getRootElement(messageContext.getRequest().getPayloadSource()); Object[] args = getMethodArguments(payloadElement, methodEndpoint.getMethod()); Object result = methodEndpoint.invoke(args); if (result != null && result instanceof Source) { Source responseSource = (Source) result; WebServiceMessage response = messageContext.getResponse(); transform(responseSource, response.getPayloadResult()); } }
/** Supports methods with @XPathParam parameters, and return either {@code Source} or nothing. */ @Override protected boolean supportsInternal(MethodEndpoint methodEndpoint) { Method method = methodEndpoint.getMethod(); if (!(Source.class.isAssignableFrom(method.getReturnType()) || Void.TYPE.equals(method.getReturnType()))) { return false; } Class<?>[] parameterTypes = method.getParameterTypes(); for (int i = 0; i < parameterTypes.length; i++) { if (getXPathParamAnnotation(method, i) == null || !isSupportedType(parameterTypes[i])) { return false; } } return true; }
private Object[] getMethodArguments(Element payloadElement, Method method) throws XPathExpressionException { Class<?>[] parameterTypes = method.getParameterTypes(); XPath xpath = createXPath(); Object[] args = new Object[parameterTypes.length]; for (int i = 0; i < parameterTypes.length; i++) { String expression = getXPathParamAnnotation(method, i).value(); QName conversionType; if (Boolean.class.isAssignableFrom(parameterTypes[i]) || Boolean.TYPE.isAssignableFrom(parameterTypes[i])) {
/** * Returns the root element of the given source. * * @param source the source to get the root element from * @return the root element */ private Element getRootElement(Source source) throws TransformerException { DOMResult domResult = new DOMResult(); transform(source, domResult); Document document = (Document) domResult.getNode(); return document.getDocumentElement(); }
@Override protected void invokeInternal(MessageContext messageContext, MethodEndpoint methodEndpoint) throws Exception { Element payloadElement = getRootElement(messageContext.getRequest().getPayloadSource()); Object[] args = getMethodArguments(payloadElement, methodEndpoint.getMethod()); Object result = methodEndpoint.invoke(args); if (result != null && result instanceof Source) { Source responseSource = (Source) result; WebServiceMessage response = messageContext.getResponse(); transform(responseSource, response.getPayloadResult()); } }
/** Supports methods with @XPathParam parameters, and return either <code>Source</code> or nothing. */ @Override protected boolean supportsInternal(MethodEndpoint methodEndpoint) { Method method = methodEndpoint.getMethod(); if (!(Source.class.isAssignableFrom(method.getReturnType()) || Void.TYPE.equals(method.getReturnType()))) { return false; } Class<?>[] parameterTypes = method.getParameterTypes(); for (int i = 0; i < parameterTypes.length; i++) { if (getXPathParamAnnotation(method, i) == null || !isSupportedType(parameterTypes[i])) { return false; } } return true; }
private Object[] getMethodArguments(Element payloadElement, Method method) throws XPathExpressionException { Class<?>[] parameterTypes = method.getParameterTypes(); XPath xpath = createXPath(); Object[] args = new Object[parameterTypes.length]; for (int i = 0; i < parameterTypes.length; i++) { String expression = getXPathParamAnnotation(method, i).value(); QName conversionType; if (Boolean.class.isAssignableFrom(parameterTypes[i]) || Boolean.TYPE.isAssignableFrom(parameterTypes[i])) {
/** * Returns the root element of the given source. * * @param source the source to get the root element from * @return the root element */ private Element getRootElement(Source source) throws TransformerException { DOMResult domResult = new DOMResult(); transform(source, domResult); Document document = (Document) domResult.getNode(); return document.getDocumentElement(); }
/** Supports methods with @XPathParam parameters, and return either {@code Source} or nothing. */ @Override protected boolean supportsInternal(MethodEndpoint methodEndpoint) { Method method = methodEndpoint.getMethod(); if (!(Source.class.isAssignableFrom(method.getReturnType()) || Void.TYPE.equals(method.getReturnType()))) { return false; } Class<?>[] parameterTypes = method.getParameterTypes(); for (int i = 0; i < parameterTypes.length; i++) { if (getXPathParamAnnotation(method, i) == null || !isSupportedType(parameterTypes[i])) { return false; } } return true; }
/** * Returns the root element of the given source. * * @param source the source to get the root element from * @return the root element */ private Element getRootElement(Source source) throws TransformerException { DOMResult domResult = new DOMResult(); transform(source, domResult); Document document = (Document) domResult.getNode(); return document.getDocumentElement(); }