use of javax.xml.ws.ResponseWrapper in project cxf by apache.
the class JaxWsServiceConfiguration method getResponseWrapperPartName.
@Override
public String getResponseWrapperPartName(OperationInfo op, Method method) {
method = getDeclaredMethod(method);
WebResult webResult = getWebResult(method);
ResponseWrapper rw = method.getAnnotation(ResponseWrapper.class);
if (rw != null) {
String pn = getWithReflection(ResponseWrapper.class, rw, "partName");
if (pn != null) {
return pn;
}
}
int countOut = 0;
int countHeaders = 0;
if (webResult != null && webResult.header()) {
countHeaders++;
} else if (method.getReturnType() != Void.TYPE) {
countOut++;
}
for (int x = 0; x < method.getParameterTypes().length; x++) {
WebParam parm = getWebParam(method, x);
if (parm != null) {
if (parm.header()) {
countHeaders++;
}
if (parm.mode() != WebParam.Mode.IN) {
countOut++;
}
}
}
if (countHeaders > 0 && countOut == 0) {
// thus return the default for an empty part of "result"
return "result";
}
return null;
}
use of javax.xml.ws.ResponseWrapper in project cxf by apache.
the class JaxWsServiceConfiguration method getResponseWrapperName.
@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;
}
Aggregations