// find the right one. For each matching operation which has an
// equal number of "in" parameters, try deserializing. If we
// don't succeed for any of the candidates, punt.
for (int i = 0; i < operations.length; i++) {
OperationDesc operation = operations[i];
// See if any information is coming from a header
boolean needHeaderProcessing =
needHeaderProcessing(operation, isResponse);
// Make a quick check to determine if the operation
// could be a match.
// 1) The element is the first param, DOCUMENT, (i.e.
// don't know the operation name or the number
// of params, so try all operations).
// or (2) Style is literal
// If the Style is LITERAL, the numParams may be inflated
// as in the following case:
// <getAttractions xmlns="urn:CityBBB">
// <attname>Christmas</attname>
// <attname>Xmas</attname>
// </getAttractions>
// for getAttractions(String[] attName)
// numParams will be 2 and and operation.getNumInParams=1
// or (3) Number of expected params is
// >= num params in message
if (operation.getStyle() == Style.DOCUMENT ||
operation.getStyle() == Style.WRAPPED ||
operation.getUse() == Use.LITERAL ||
(acceptMissingParams ?
(operation.getNumInParams() >= numParams) :
(operation.getNumInParams() == numParams))) {
boolean isEncoded = operation.getUse() == Use.ENCODED;
rpcHandler.setOperation(operation);
try {
// If no operation name and more than one
// parameter is expected, don't
// wrap the rpcHandler in an EnvelopeHandler.
if ( ( msgContext.isClient() &&
operation.getStyle() == Style.DOCUMENT ) ||
( !msgContext.isClient() &&
operation.getStyle() == Style.DOCUMENT &&
operation.getNumInParams() > 0 ) ) { context.pushElementHandler(rpcHandler);
context.setCurElement(null);
} else {
context.pushElementHandler(
new EnvelopeHandler(rpcHandler));
context.setCurElement(this);