private void _callRest(PageContext pc, Component component, UDF udf,String path, Struct variables, Result result, MimeType best,MimeType[] produces, boolean suppressContent, Key methodName) throws PageException, IOException, ConverterException {
FunctionArgument[] fa=udf.getFunctionArguments();
Struct args=new StructImpl(),meta;
Key name;
String restArgName,restArgSource,value;
for(int i=0;i<fa.length;i++){
name = fa[i].getName();
meta=fa[i].getMetaData();
restArgSource=meta==null?"":Caster.toString(meta.get(KeyConstants._restArgSource,""),"");
if("path".equalsIgnoreCase(restArgSource))
setValue(fa[i],args,name, variables.get(name,null));
if("query".equalsIgnoreCase(restArgSource) || "url".equalsIgnoreCase(restArgSource))
setValue(fa[i],args,name, pc.urlScope().get(name,null));
if("form".equalsIgnoreCase(restArgSource))
setValue(fa[i],args,name, pc.formScope().get(name,null));
if("cookie".equalsIgnoreCase(restArgSource))
setValue(fa[i],args,name, pc.cookieScope().get(name,null));
if("header".equalsIgnoreCase(restArgSource) || "head".equalsIgnoreCase(restArgSource)) {
restArgName=meta==null?"":Caster.toString(meta.get(KeyConstants._restArgName,""),"");
if(StringUtil.isEmpty(restArgName))restArgName=name.getString();
value=ReqRspUtil.getHeaderIgnoreCase(pc, restArgName, null);
setValue(fa[i],args,name,value);
}
if("matrix".equalsIgnoreCase(restArgSource))
setValue(fa[i],args,name, result.getMatrix().get(name,null));