boolean isRoot = true;
String root = attributes.getValue(Constants.URI_DEFAULT_SOAP_ENC,
Constants.ATTR_ROOT);
if ((root != null) && root.equals("0")) isRoot = false;
MessageContext msgContext = context.getMessageContext();
OperationDesc [] operations = null;
try {
if(msgContext != null) {
operations = msgContext.getPossibleOperationsByQName(qname);
}
// If there's only one match, set it in the MC now
if ((operations != null) && (operations.length == 1))
msgContext.setOperation(operations[0]);
} catch (org.apache.axis.AxisFault e) {
// SAXException is already known to this method, so I
// don't have an exception-handling propogation explosion.
throw new SAXException(e);
}
Style style = operations == null ? Style.RPC : operations[0].getStyle();
/** Now we make a plain SOAPBodyElement IF we either:
* a) have an non-root element, or
* b) have a non-RPC service
*/
if (localName.equals(Constants.ELEM_FAULT) &&
namespace.equals(msgContext.getSOAPConstants().getEnvelopeURI())) {
element = new SOAPFault(namespace, localName, prefix,
attributes, context);
handler = new SOAPFaultBuilder((SOAPFault)element,
context);
} else if (!gotRPCElement) {
if (isRoot && (style != Style.MESSAGE)) {
gotRPCElement = true;
try {
element = new RPCElement(namespace, localName, prefix,
attributes, context, operations);
} catch (org.apache.axis.AxisFault e) {
// SAXException is already known to this method, so I
// don't have an exception-handling propogation explosion.
//
throw new SAXException(e);
}
// Only deserialize this way if there is a unique operation
// for this QName. If there are overloads,
// we'll need to start recording. If we're making a high-
// fidelity recording anyway, don't bother (for now).
if (msgContext != null && !msgContext.isHighFidelity() &&
(operations == null || operations.length == 1)) {
((RPCElement)element).setNeedDeser(false);
handler = new RPCHandler((RPCElement)element, false);
if (operations != null) {
((RPCHandler)handler).setOperation(operations[0]);
msgContext.setOperation(operations[0]);
}
}
}
}