parameters = (Parameters)bEntry.getParameters().get(tmpOp);
break;
}
}
if(operation == null || parameters == null)
throw new RPCException("Cannot locate method " + methodName + " in webservice " + wsdlUrl);
org.apache.axis.client.Call call = (Call)axisService.createCall(QName.valueOf(port.getName()), QName.valueOf(tmpOp.getName()));
if(!StringUtil.isEmpty(username,true)){
call.setUsername(username);
call.setPassword(password);
}
org.apache.axis.encoding.TypeMapping tm = (org.apache.axis.encoding.TypeMapping)
axisService.getTypeMappingRegistry().getDefaultTypeMapping();
//TypeMappingRegistry reg=(TypeMappingRegistry) axisService.getTypeMappingRegistry();
//tm=reg.getOrMakeTypeMapping("http://schemas.xmlsoap.org/soap/encoding/");
tm=call.getMessageContext().getTypeMapping();
Vector<String> inNames = new Vector<String>();
Vector<Parameter> inTypes = new Vector<Parameter>();
Vector<String> outNames = new Vector<String>();
Vector<Parameter> outTypes = new Vector<Parameter>();
for(int j = 0; j < parameters.list.size(); j++) {
p = (Parameter)parameters.list.get(j);
map(pc,secondChanceConfig,call,tm,p.getType());
switch(p.getMode()) {
case Parameter.IN:
inNames.add(p.getQName().getLocalPart());
inTypes.add(p);
break;
case Parameter.OUT:
outNames.add(p.getQName().getLocalPart());
outTypes.add(p);
break;
case Parameter.INOUT:
inNames.add(p.getQName().getLocalPart());
inTypes.add(p);
outNames.add(p.getQName().getLocalPart());
outTypes.add(p);
break;
}
}
// set output type
if (parameters.returnParam != null) {
QName rtnQName = parameters.returnParam.getQName();
TypeEntry rtnType = parameters.returnParam.getType();
map(pc,secondChanceConfig,call,tm,rtnType);
outNames.add(rtnQName.getLocalPart());
outTypes.add(parameters.returnParam);
}
//Iterator it = outTypes.iterator();
// check arguments
Object[] inputs = new Object[inNames.size()];
TimeZone tz;
if(pc==null)tz=ThreadLocalPageContext.getTimeZone(secondChanceConfig);
else tz=ThreadLocalPageContext.getTimeZone(pc);
if(arguments!=null) {
if(inNames.size() != arguments.length)
throw new RPCException("Invalid arguments count for operation " + methodName+" ("+arguments.length+" instead of "+inNames.size()+")");
for(int pos = 0; pos < inNames.size(); pos++) {
p = inTypes.get(pos);
inputs[pos]=getArgumentData(tm,tz, p, arguments[pos]);
}
}
else {
UDFUtil.argumentCollection(namedArguments);
if(inNames.size() != namedArguments.size())
throw new RPCException("Invalid arguments count for operation " + methodName+" ("+namedArguments.size()+" instead of "+inNames.size()+")");
Object arg;
for(int pos = 0; pos < inNames.size(); pos++) {
p = inTypes.get(pos);
arg=namedArguments.get(KeyImpl.init(p.getName()),null);
if(arg==null) {
throw new RPCException("Invalid arguments for operation " + methodName,
getErrorDetailForArguments(inNames.toArray(new String[inNames.size()]),CollectionUtil.keysAsString(namedArguments)));
}
inputs[pos]=getArgumentData(tm,tz, p, arg);
}
}