{
UPnPAction act = service.getAction( "UpdateDownload" );
if ( act == null ){
throw( new UPnPException( "UpdateDownload not supported" ));
}else{
UPnPActionInvocation inv = act.getInvocation();
inv.addArgument( "NewClientID", client_id );
inv.addArgument( "NewTorrentHash", hash );
inv.addArgument( "NewPieceRequiredMap", required_map );
UPnPActionArgument[] args = inv.invoke();
String have = null;
String status = null;
for (int i=0;i<args.length;i++){
UPnPActionArgument arg = args[i];
String name = arg.getName();
if ( name.equalsIgnoreCase("NewPieceHaveMap")){
have = arg.getValue();
}else if ( name.equalsIgnoreCase("NewStatus")){
status = arg.getValue();
}
}
if ( have != null && status != null ){
return( new String[]{ have, status });
}
throw( new UPnPException( "have or status not found" ));
}
}