String methodName = null;
try {
AxisOperation op = inMessage.getOperationContext().getAxisOperation();
AxisService service = inMessage.getAxisService();
OMElement methodElement = inMessage.getEnvelope().getBody().getFirstElement();
AxisMessage inAxisMessage = op.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
String messageNameSpace = null;
QName elementQName;
methodName = op.getName().getLocalPart();
Invoker invoker = (Invoker) invokerCache.get(methodName);
if (invoker==null) {
if (orb==null) {
Parameter orbParam = service.getParameter(ORB_LITERAL);
orb = orbParam != null ? (ORB) orbParam.getValue() : CorbaUtil.getORB(service);
}
org.omg.CORBA.Object obj = CorbaUtil.resolveObject(service, orb);
Parameter idlParameter = service.getParameter(IDL_LITERAL);
if (idlParameter==null)
throw new CorbaInvocationException("IDL not found");
IDL idl = (IDL) idlParameter.getValue();
invoker = CorbaUtil.getInvoker(service, obj, idl, methodName);
invokerCache.put(methodName, invoker);
}
Object resObject = null;
Member[] params = null;
Object[] outParamValues = null;
if (inAxisMessage != null) {
if (inAxisMessage.getElementQName() != null) {
elementQName = inAxisMessage.getElementQName();
messageNameSpace = elementQName.getNamespaceURI();
OMNamespace namespace = methodElement.getNamespace();
if (messageNameSpace != null) {
if (namespace == null) {
throw new AxisFault("namespace mismatch require " +
messageNameSpace +
" found none");
}
if (!messageNameSpace.equals(namespace.getNamespaceURI())) {
throw new AxisFault("namespace mismatch require " +
messageNameSpace +
" found " + methodElement.getNamespace().getNamespaceURI());
}
} else if (namespace != null) {
throw new AxisFault("namespace mismatch. Axis Oepration expects non-namespace " +
"qualified element. But received a namespace qualified element");
}
Object[] objectArray = CorbaUtil.extractParameters(methodElement, invoker.getParameterMembers());
invoker.setParameters(objectArray);
}
resObject = invoker.invoke();
params = invoker.getParameterMembers();
outParamValues = invoker.getOutParameterValuess();
}
if (messageNameSpace == null) {
AxisMessage outaxisMessage = op.getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
QName qname = outaxisMessage.getElementQName();
if (qname != null) {
messageNameSpace = qname.getNamespaceURI();
}
}