use of javax.jws.WebParam in project cxf by apache.
the class JaxWsServiceConfiguration method isInOutParam.
@Override
public Boolean isInOutParam(Method method, int j) {
method = getDeclaredMethod(method);
if (j == -1) {
return !method.getReturnType().equals(void.class);
}
WebParam webParam = getWebParam(method, j);
if (webParam != null && webParam.mode().equals(Mode.INOUT)) {
return Boolean.TRUE;
}
return Boolean.FALSE;
}
use of javax.jws.WebParam in project cxf by apache.
the class JaxWsServiceConfiguration method getPartName.
private QName getPartName(OperationInfo op, Method method, int paramNumber, MessageInfo mi, String prefix, boolean isIn) {
int partIndex = getPartIndex(method, paramNumber, isIn);
method = getDeclaredMethod(method);
WebParam param = getWebParam(method, paramNumber);
String tns = mi.getName().getNamespaceURI();
String local = null;
if (param != null) {
if (Boolean.TRUE.equals(isRPC(method)) || isDocumentBare(method) || param.header()) {
local = param.partName();
}
if (local == null || local.length() == 0) {
local = param.name();
}
}
if (local == null || local.length() == 0) {
if (Boolean.TRUE.equals(isRPC(method)) || !Boolean.FALSE.equals(isWrapped(method))) {
local = getDefaultLocalName(op, method, paramNumber, partIndex, prefix);
} else {
local = getOperationName(op.getInterface(), method).getLocalPart();
}
}
return new QName(tns, local);
}
use of javax.jws.WebParam in project cxf by apache.
the class JaxWsServiceConfiguration method isOutParam.
@Override
public Boolean isOutParam(Method method, int j) {
method = getDeclaredMethod(method);
if (j == -1) {
return !method.getReturnType().equals(void.class);
}
WebParam webParam = getWebParam(method, j);
if (webParam != null && (webParam.mode().equals(Mode.OUT) || webParam.mode().equals(Mode.INOUT))) {
return Boolean.TRUE;
}
return method.getParameterTypes()[j] == Holder.class;
}
use of javax.jws.WebParam in project cxf by apache.
the class TestRPCHeaderTest method testInOutHeader.
@Test
public void testInOutHeader() {
Method[] meths = cls.getMethods();
for (Method m : meths) {
if ("testInOutHeader".equals(m.getName())) {
Annotation[][] annotations = m.getParameterAnnotations();
assertEquals(2, annotations.length);
assertEquals(1, annotations[1].length);
assertTrue(annotations[1][0] instanceof WebParam);
WebParam parm = (WebParam) annotations[1][0];
assertEquals("http://apache.org/header_test/rpc/types", parm.targetNamespace());
assertEquals("inOutHeader", parm.partName());
assertEquals("headerMessage", parm.name());
assertTrue(parm.header());
}
}
}
use of javax.jws.WebParam in project cxf by apache.
the class TestRPCHeaderTest method testHeader1.
@Test
public void testHeader1() {
Method[] meths = cls.getMethods();
for (Method m : meths) {
if ("testHeader1".equals(m.getName())) {
Annotation[][] annotations = m.getParameterAnnotations();
assertEquals(2, annotations.length);
assertEquals(1, annotations[0].length);
assertTrue(annotations[0][0] instanceof WebParam);
WebParam parm = (WebParam) annotations[0][0];
assertEquals("http://apache.org/header_test/rpc/types", parm.targetNamespace());
assertEquals("inHeader", parm.partName());
assertEquals("headerMessage", parm.name());
assertTrue(parm.header());
}
}
}
Aggregations