log.debug(JavaUtils.getMessage("enter00",
"RPCProvider.processMessage()"));
}
SOAPService service = msgContext.getService();
ServiceDesc serviceDesc = service.getServiceDescription();
OperationDesc operation = msgContext.getOperation();
Vector bodies = reqEnv.getBodyElements();
if (log.isDebugEnabled()) {
log.debug(JavaUtils.getMessage("bodyElems00", "" + bodies.size()));
log.debug(JavaUtils.getMessage("bodyIs00", "" + bodies.get(0)));
}
/* Loop over each entry in the SOAPBody - each one is a different */
/* RPC call. */
/******************************************************************/
for ( int bNum = 0 ; bNum < bodies.size() ; bNum++ ) {
RPCElement body;
// If this is a regular old SOAPBodyElement, and it's a root,
// we're probably a non-wrapped doc/lit service. In this case,
// we deserialize the element, and create an RPCElement "wrapper"
// around it which points to the correct method.
// FIXME : There should be a cleaner way to do this...
if (!(bodies.get(bNum) instanceof RPCElement)) {
SOAPBodyElement bodyEl = (SOAPBodyElement)bodies.get(bNum);
// igors: better check if bodyEl.getID() != null
// to make sure this loop does not step on SOAP-ENC objects
// that follow the parameters! FIXME?
if (bodyEl.isRoot() && operation != null) {
ParameterDesc param = operation.getParameter(bNum);
// at least do not step on non-existent parameters!
if(param != null) {
Object val = bodyEl.getValueAsType(param.getTypeQName());
body = new RPCElement("",
operation.getName(),
new Object [] { val });
}
else continue;
} else {
continue;
}
} else {
body = (RPCElement) bodies.get( bNum );
}
String methodName = body.getMethodName();
Vector args = body.getParams();
int numArgs = args.size();
// This may have changed, so get it again...
// FIXME (there should be a cleaner way to do this)
operation = msgContext.getOperation();
if (operation == null) {
QName qname = new QName(body.getNamespaceURI(),
body.getName());
operation = serviceDesc.getOperationByElementQName(qname);
}
if (operation == null) {
throw new AxisFault(JavaUtils.getMessage("noSuchOperation",
methodName));