if (webMessage instanceof WebResult) {
WebResult webResult = (WebResult) webMessage;
if ("".equals(webResult.getElementName())) {
result.addError(webResult.getWebMethod(), "A web result that is a header must specify a name with the @WebResult annotation.");
}
DecoratedTypeMirror type = (DecoratedTypeMirror) webResult.getType();
if ((type.isCollection()) || (type.isArray())) {
String description = type.isCollection() ? "an instance of java.util.Collection" : "an array";
result.addWarning(webMethod, "The header return value that is " + description + " may not (de)serialize " +
"correctly. The spec is unclear as to how this should be handled.");
}
}
else {
WebParam webParam = (WebParam) webMessage;
if ("".equals(webParam.getElementName())) {
result.addError(webParam, "A header parameter must specify a name using the @WebParam annotation.");
}
DecoratedTypeMirror type = (DecoratedTypeMirror) webParam.getType();
if (type.isCollection() || (type.isArray())) {
String description = type.isCollection() ? "an instance of java.util.Collection" : "an array";
result.addWarning(webParam, "The header parameter that is " + description + " may not (de)serialize correctly. " +
"The spec is unclear as to how this should be handled.");
}
}
}
if (parameterStyle == SOAPBinding.ParameterStyle.BARE) {
if (webMessage instanceof WebParam) {
DecoratedTypeMirror paramType = (DecoratedTypeMirror) ((WebParam) webMessage).getType();
if (paramType.isArray()) {
result.addError(webMethod, "A BARE web method must not have an array as a parameter.");
}
}
else if (webMessage instanceof RequestWrapper) {
//todo: throw a runtime exception? This is a problem with the engine, not the user.
result.addError(webMethod, "A BARE web method shouldn't have a request wrapper.");
}
else if (webMessage instanceof ResponseWrapper) {
//todo: throw a runtime exception? This is a problem with the engine, not the user.
result.addError(webMethod, "A BARE web method shouldn't have a response wrapper.");
}
}
else if (soapBindingStyle == SOAPBinding.Style.RPC) {
Collection<WebMessagePart> parts = webMessage.getParts();
for (WebMessagePart part : parts) {
if (part instanceof WebParam) {
WebParam webParam = (WebParam) part;
DecoratedTypeMirror paramType = (DecoratedTypeMirror) webParam.getType();
if (paramType.isCollection() || paramType.isArray()) {
String description = paramType.isCollection() ? "An instance of java.util.Collection" : "An array";
result.addWarning(webParam, description + " as an RPC-style web message part may " +
"not be (de)serialized as you expect. The spec is unclear as to how this should be handled.");
}
}
}