Detecting static calls in methods via Class.forName(...)

Hi!
I'm trying to detect, if a method (or a contructor) of a Class object, loaded by Class.forName(...) contains a static call like System.out.println( "some text" );
I need it to figure out if (in this case above) the class "System" is needed for running this example class.
I don't have the source code (and don't want it anyway) to write a parser for it. I just want to extract this single information: Is there a method/contructor in the given class containing static calls by any other classes and what's the the of these classes?
Anybody an idea?
Thoto

I'm trying to detect, if a method (or acontructor)
of a Class object, loaded by Class.forName(...)
contains a static call like System.out.println("some
text" );BCEL should be able to do this.But I need to do that in my own program.
System.out.println() is not a static method.That's right. If it's static or not doesn't really matter, it's just the information WHICH class is embedded into this call. It could also be a call like
int i = Integer.MAX_VALUE.I just need (in that case) the informatation that the class "Integer" is needed to proceed that call.
You can use javap to find this, or the BCEL library.I already did that with javap. But it's useless for me, I need it in my own program. I don't want to decompile some program. I have no illegal intentions in hacking or so. It's for my own programs, but I don't want to scan the source code.
Unless this is homework, why would you want to know
this information?That sounds, like you know the answer, but can't tell me, because it's the most important treasure in the world and THEY will kill you if you tell others... :-)
No, it's not a homework and I don't want any source code from you, I'm a curious guy.

Similar Messages

  • How can create the object ? Via class.forName

    Hi,
    i want to create the object via class.forname?........
    i have tryed like this Class obj=Class.forName("sample.Employee");
    but it gives error like this......
    java.lang.InstantiationException: sample.Employee
         at java.lang.Class.newInstance0(Class.java:291)
         at java.lang.Class.newInstance(Class.java:259)
         at sample.ArrayListTest.main(ArrayListTest.java:22)

    The line
    Class obj=Class.forName("sample.Employee");does NOT create a new object of class
    sample.Employee. It only loads the class and creates
    the Class object. You have to call newInstance() to
    create a new instance of the class:
    Object obj =
    Class.forName("sample.Employee").newInstance();I guess you already did something like that, because
    forName() itself doesn't throw an
    InstantiationException.
    For this to work, class sample.Employee must be in
    the classpath and it must have a public constructor
    that takes no arguments.this is my full code it dosn't work i don,t know
    public class ArrayListTest {
    public ArrayListTest() {  }
    public static void main(String[] args) {
    ArrayList employees = new ArrayList();
    // create some employees
    /* Employee employee_1 = new Employee("John", 2000);
    Employee employee_2 = new Employee("Carl", 3000);
    Employee employee_3 = new Employee("Ron", 4000);*/
    /*instead of this Employee employee_1 i want to create the new obeject by using*/
    try{
    Object obj = Class.forName("sample.Employee").newInstance();
    catch(Exception e)
    e.printStackTrace();
    // add them to your list
    //employees.add(employee_1);
    //employees.add(employee_2);
    //employees.add(employee_3);
    // display only the names your list
    for(int j = 0; j < employees.size(); j++) {
    Employee temp = (Employee)employees.get(j);
    System.out.println("nr. "+(j+1)+": "+temp.getName()+"\nnr. "+(j+1)+": "+temp.getSalary());
    // invoke the toString()-method from Employee
    for(int j = 0; j < employees.size(); j++) {
    Employee temp = (Employee)employees.get(j);
    System.out.println(temp.toString());
    } // class ArrayListTest
    again the same error occur................

  • Calling a method via String representation of instance

    Is it possible to call a method of a specific (and already existing) instance of a class using a string representation of the instance?

    By "String representation of an instance," I simply mean a string that has the same format as a normal method call would have. So where a method would normally be called like this:
    ClassX itsInstance = new ClassX();
    itsInstance.methodX();
    The string representation would be:
    String instanceName = "itsInstance";
    And there would be some way of using this string to call the method referred to by instanceName.
    The idea here is that I want to use the existing instance, whereas using reflection, as below, would create a new instance:
    String className = "X";
    String methodName = "print";
    Class xClass = Class.forName(className);
    Method xMethod = xClass.getMethod(methodName,null);
    Object object = xClass.newInstance();
    xMethod.invoke(object,null);

  • How to call a method from class interface

    Hi ,
    I want to call a method from a 'class interface' in a BADI .
    Class Interface -- /SAPSRM/CL_PDO_DO_BASE
    Method -- /SAPSRM/IF_PDO_DO_PARTNER_BASE~UPDATE_ITEM_PARTNERS
    Please let me know how can I call this method in my BADI.
    Thanks-

    Hi Harmeet,
    Follow these simple steps.
    1. Create an instance of class interface /SAPSRM/CL_PDO_DO_BASE if method /SAPSRM/IF_PDO_DO_PARTNER_BASE~UPDATE_ITEM_PARTNERS is instance method and
    call instance -> /SAPSRM/IF_PDO_DO_PARTNER_BASE~UPDATE_ITEM_PARTNERS
    2.if method /SAPSRM/IF_PDO_DO_PARTNER_BASEUPDATE_ITEM_PARTNERS is static method ,call directly using class interface like /SAPSRM/CL_PDO_DO_BASE=> /SAPSRM/IF_PDO_DO_PARTNER_BASEUPDATE_ITEM_PARTNERS.
    If you feel any dificulty in declaring instances and call methods, 
    Goto EDIT-> Pattern ->ABAP Object Patterns, Give class name , instance name and method, you got the required code.
    Thanks,
    Prasad.

  • Calling a method in Class from webdynpro

    Hi All,
    I have to perform some action when i click the button created in my webdynpro screen.
    However I must not write the code for the button action inside the button event. But I have to create a class and inside the class i have to create the method for this button event.
    Can anyone tell me how to call a method in a class created in SE24 from webdynpro on clicking the button.
    Thanks in advance.

    hi..
    When you want to perform some action after clicking a Button, then you have to write the code only in 'Events' - 'On Action' event. From your question, i assume that, you wanna use Assistance class in your webdynpro so as to increase better performance. Here is the link which will guide yuo with screen shot for using assistance class in WD-ABAP.
    http://wiki.sdn.sap.com/wiki/display/WDABAP/AssistanceclassfunctionalityinWDA
    thanks,
    Padma

  • Calling a method via invokeMethod (JDI)

    Hi !
    Does anybody know how to invoke a method
    via the invokeMethod method of the Java Debug Interface (JDI).
    This suspends the execution of the program !
    I've read somewhere that the vm must be resumed,
    but I don't see how, as a vm.resume() after the
    invocation is never reached !
    Thanx for any help !
    Alex

    I have the same problem ..Null pointer exception thrown. here is my sample code that I did:
    public void methodExitEvent(MethodExitEvent event)
    ObjectReference obj = objectReference(event);
    if(obj!=null && !event.method().name().equals("<init>"))
    System.out.println(" Leaving the method " + event.method().name() + "() Object " + obj.hashCode());
    List objMethodsList= event.method().declaringType().methodsByName("methodA");
    Method emptyState= (Method)objMethodsList.get(0);
    //ClassType myClass= (ClassType)obj.referenceType();
    //Method emptyState= myClass.concreteMethodByName("methodA","()V");
    try
    Value myValue= obj.invokeMethod(event.thread(), emptyState ,null,ObjectReference.INVOKE_SINGLE_THREADED);
    catch(Exception e)
    e.printStackTrace();
    System.out.println("Error in invoking method "+e.getMessage());
    else if(obj!=null && event.method().name().equals("<init>"))
    System.out.println("Object " + obj.hashCode()+" END its life");
    and here is the trace that i got from the exception thrown:
    java.lang.NullPointerException
    at com.sun.tools.jdi.MirrorImpl.validateMirrorsOrNulls(MirrorImpl.java:8
    2)
    at com.sun.tools.jdi.ObjectReferenceImpl.invokeMethod(ObjectReferenceImp
    l.java:355)
    at EventThread.methodExitEvent(EventThread.java:186)
    at EventThread.handleEvent(EventThread.java:69)
    at EventThread.run(EventThread.java:35)
    Error in invoking method null
    Need help ASAP especially those of you who have created debugger. Im trying to create a tracer and try to invoke the method of the debugee object....

  • How to get exit code from C code when calling java method via JNI?

    Hi, All
    in my project, i need to call a java method from C code using JNI, yet I do
    not know how to
    retrieve the exit code of java program. the java code is like below
    public static void main(....)
    if(error){
    System.exit(-77);// the exit code is -77
    and the JNI c code may like below
    /* Invoke main method. */
        (*env)->CallStaticVoidMethod(env, mainClass, mainID, mainArgs);
    //here I want to retrieve the exit code from java to check if there is an
    error
    any suggestions? thanks

    Hi Liang Zhang,
    In your C code add:
    void (JNICALL y_exit)(jint code) {
    and when you are initialazing JVM options add:
    JavaVMOption options[...];
    options[...].optionString = "exit";
    options[...].extraInfo    = y_exit;
    See http://java.sun.com/j2se/1.3/docs/guide/jni/jni-12.html
    Best regards, Maksim Rashchynski.

  • Calling EJB facades via class instantiated via reflection?

    We are loading plugins via Java reflection. Anything instantiated via newInstance() does not appear to have access to the Local interface.
    Right now, to get to the session bean we must use the Remote interface. This is annoying due to the performance, and seems completely unnecessary when everything is operating in one JVM.
    Tests were done to print out the JNDI namespace and the local interfaces don't seem to be accessible. Any advice?

    My project consists of an EJB package and WAR. I have not had any problem calling the local facades from JSP, Servlet, or web service in the EJB package.
    Further, I can use XStream reflection and do local EJB calls.
    It baffles me why I can't do the local calls in some classes via InitialContext lookups.
    I will post test code next week.

  • Calling a Method in a Parent Class

    I have Class A that instantiates Class B which in turn instantiates Class C. Is there a way to call a method in Class A from Class C without having to pass a reference of A all the way down to C? Is there thread stack information that I can access that will allow me to get Class A's 'handle'?

    tpaulsz wrote:
    The OP is not confusing instantiates with inherits.
    Class A is class that's exposing web service methods.
    Class B represents a group of business rule classes.
    Class C is transaction handler class that is responsible for checking out connections from a db connections pool.
    The web services all require user information, for auth and auth purposes, and they've not been required outside of Class A - until now. I now have to provide RLS on the database information so I need the user information for the Oracle Proxy User connection property.
    This is a very mature application with many Class A and Class B classes so passing the user information from class to class would be a big job. Furthermore, there are some non-user processes that will also be calling on Class C that don't need RLS. Since the StackElements are available through Thread.currentThread().getStackTrace(), I was hoping that there was another stack that I could traverse to eventually find a Class A class that's been set up with an with interface that has a getUserInfo method.Any you wanted to extract the user info for every single database operation even when a single business rule calls more than one?
    Or when a single web service operation calls more than one business rule?
    If you don't do that then how did you plan on letting method B know that method A has already done it?
    You might be able to stick the data in a ThreadLocal if there is in fact only one thread of execution.
    Myself I always considered attempting to manage web users of a business application via a a database or OS authentication to be more trouble than it was worth.

  • How to call a method of another class ?

    Hello,
    I�d like to know how to call a method of another class. I have to classes (class 1 and class 2), class 1 instantiates an object of class 2 and executes the rest of the method. Later, class 1 has to call a method of class 2, sending a message to do something in the object... Does anybody know how to do that ? Do I have to use interface ? Could you please help me ?
    Thanks.
    Bruno.

    Hi Schiller,
    The codes are the following:
    COMECO
    import javax.swing.UIManager;
    import java.awt.*;
    import java.net.*;
    import java.io.*;
    import java.awt.event.*;
    import javax.swing.*;
    //Main method
    class comeco {
    public static void main(String[] args) {
    try {
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    catch(Exception e) {
    AGORA testeagora=new AGORA();
    // Code for socket
    int port;
         ServerSocket server_socket;
         BufferedReader input;
         try {
         port = Integer.parseInt(args[0]);
         catch (Exception e) {
         System.out.println("comeco ---> port = 1500 (default)");
         port = 1500;
         try {
         server_socket = new ServerSocket(port);
         System.out.println("comeco ---> Server waiting for client on port " +
                   server_socket.getLocalPort());
         // server infinite loop
         while(true) {
              Socket socket = server_socket.accept();
              System.out.println("comeco ---> New connection accepted " +
                        socket.getInetAddress() +
                        ":" + socket.getPort());
              input = new BufferedReader(new InputStreamReader(socket.getInputStream()));
              // print received data
              try {
              while(true) {
                   String message = input.readLine();
                   if (message==null) break;
                   System.out.println("comeco ---> " + message);
    testeagora.teste(message);
              catch (IOException e) {
              System.out.println(e);
              // connection closed by client
              try {
              socket.close();
              System.out.println("Connection closed by client");
              catch (IOException e) {
              System.out.println(e);
         catch (IOException e) {
         System.out.println(e);
    AGORA
    import javax.swing.UIManager;
    import java.awt.*;
    import java.awt.event.*;
    import java.net.*;
    import java.io.*;
    import javax.swing.*;
    import java.net.*;
    //public class AGORA {
    public class AGORA {
    boolean packFrame = false;
    //Construct the application
    public AGORA() {
    try {
    Main frame = new Main();
    System.out.println("agora ---> Criou o frame");
    //Validate frames that have preset sizes
    //Pack frames that have useful preferred size info, e.g. from their layout
    if (packFrame)
    frame.pack();
    else
    frame.validate();
    //Center the window
    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    Dimension frameSize = frame.getSize();
    if (frameSize.height > screenSize.height)
    frameSize.height = screenSize.height;
    if (frameSize.width > screenSize.width)
    frameSize.width = screenSize.width;
    frame.setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2);
    frame.setVisible(true);
    catch(Exception e)
    { System.out.println("agora ---> " +e);
    // Tem que criar a THREAD e ver se funciona
    public void remontar (final String msg) {
    try {
                   System.out.println("agora ---> Passou pelo Runnable");
    System.out.println("agora --> Mensagem que veio do comeco para agora: "+ msg);
    Main.acao(msg);
    catch(Exception x) {
    x.printStackTrace();
    MAIN
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import com.borland.jbcl.layout.*;
    import javax.swing.border.*;
    import java.net.*;
    import java.io.*;
    public class Main extends JFrame {
    // ALL THE CODE OF THE INTERFACE
    //Construct the frame
    public Main() {
    enableEvents(AWTEvent.WINDOW_EVENT_MASK);
    try {
    jbInit();
    catch(Exception e) {
    e.printStackTrace();
    public void acao() {
    // C�digo para mudar a interface
    Runnable setTextRun=new Runnable() {
    public void run() {
    try {
                   System.out.println("main ---> Passou pelo Runnable");
    TStatus.setText("main ---> Funcionou");
    catch(Exception x) {
    x.printStackTrace();
    System.out.println("main ---> About to invokelater");
    SwingUtilities.invokeLater(setTextRun);
    System.out.println("main ---> Back from invokelater");
    // Aqui vai entrar o m�todo para ouvir as portas sockets.
    // Ele deve ouvir e caso haja alguma nova mensagem, trat�-la para
    // alterar as vari�veis e redesenhar os pain�is
    // Al�m disso, o bot�o de refresh deve aparecer ativo em vermelho
    //Component initialization
    private void jbInit() throws Exception {
    // Initialize the interface
    //Setting | Host action performed
    public void SetHost_actionPerformed(ActionEvent e) {
         int port;
         ServerSocket server_socket;
         BufferedReader input;
    System.out.println("main ---> port = 1500 (default)");
         port = 1500;
         try {
         server_socket = new ServerSocket(port);
         System.out.println("main ---> Server waiting for client on port " +
                   server_socket.getLocalPort());
         // server infinite loop
    while(true) {
              Socket socket = server_socket.accept();
              System.out.println("main ---> New connection accepted " +
                        socket.getInetAddress() +
                        ":" + socket.getPort());
              input = new BufferedReader(new InputStreamReader(socket.getInputStream()));
    String espaco=new String(": ");
         JLabel teste2=new JLabel(new ImageIcon("host.gif"));
              PHost.add(teste2);
    System.out.println("main ---> Adicionou host na interface");
              repaint();
    System.out.println("main ---> Redesenhou a interface");
              setVisible(true);
              // print received data
              try {
              while(true) {
                   String message = input.readLine();
                   if (message==null) break;
                   System.out.println("main ---> " + message);
              catch (IOException e2) {
              System.out.println(e2);
              // connection closed by client
              try {
              socket.close();
              System.out.println("main ---> Connection closed by client");
              catch (IOException e3) {
              System.out.println(e3);
         catch (IOException e1) {
         System.out.println(e1);
    public void OutHost_actionPerformed(ActionEvent e) {
              repaint();
              setVisible(true);
    //Help | About action performed
    public void helpAbout_actionPerformed(ActionEvent e) {
    Main_AboutBox dlg = new Main_AboutBox(this);
    Dimension dlgSize = dlg.getPreferredSize();
    Dimension frmSize = getSize();
    Point loc = getLocation();
    dlg.setLocation((frmSize.width - dlgSize.width) / 2 + loc.x, (frmSize.height - dlgSize.height) / 2 + loc.y);
    dlg.setModal(true);
    dlg.show();
    //Overridden so we can exit on System Close
    protected void processWindowEvent(WindowEvent e) {
    super.processWindowEvent(e);
    if(e.getID() == WindowEvent.WINDOW_CLOSING) {
    fileExit_actionPerformed(null);
    public void result(final String msg) {
    // C�digo para mudar a interface
    Runnable setTextRun=new Runnable() {
    public void run() {
    try {
                   System.out.println("main ---> Chamou o m�todo result para mudar a interface");
    System.out.println("main --> Mensagem que veio do agora para main: "+ msg);
    TStatus.setText(msg);
    catch(Exception x) {
    x.printStackTrace();
    System.out.println("main --> About to invokelater");
    SwingUtilities.invokeLater(setTextRun);
    System.out.println("main --> Back from invokelater");
    []�s.

  • How call a method from another class

    i make three class.class A,class B and class C.
    class A have One button.
    Class B have a action listener of that button.
    class c have a metod like
    public void test(){     }
    how can i call a method in class b from class c;
    is it necessary to pass the class a or b through the constructor of class c or another way to call the method.

    public class Foo
        public static void main(String[] args)
            Bar.staticFn();
            Bar b = new Bar();
            b.memberFn();
    class Bar
        public void memberFn()
            System.out.println("memberFn");
        public static void staticFn()
            System.out.println("staticFn");
      }

  • Automatically detect the caller class!

    Guys,
    I have a simple but "sounds-like-general-and-interesting" doubt..
    I have a class 'A' and another class 'B'. I have a method in 'A' called 'a' calling a method in class 'B' (which is 'b').
    suppose the control is inside the method 'b' of the class 'B'.
    Now, the doubt is
    how can I find out that it was class 'A' who called the method 'b' of class 'B' from within the method 'b'?
    the scenario is a simpe loging scenario where the class 'B' is a Logger class and I want to automatically detect the class calling this component from within this component so that it can be logged too.
    Hope my problem is clear. Thankx in advance for the replies.. am stuck and confused too.. and hop there's a solution for this
    regards
    Manesh

    mgumbs is right - typically a Logger class will accept a context (Object) to indicate where the message has come from. Sometimes people pass in "this", sometimes they pass in "this.class" or sometimes they'll log on behalf of another class. It's pretty much the same solution - if it's needed you should supply it.
    One method made possible in J2SDK-1.4 is using a stack trace to find out what the calling class/method is. Perhaps the only way to do that would be to throw a new Exception and get hold of its stack trace elements. I suspect that this would add significant overhead, though, and I certainly wouldn't recommend it!

  • Can't load class with Class.forName()

    Hi, can somebody help me with this problem. I have clas copiled with jdk 1.3.1 (I also test it with jdk 1.4.1). If I try to load a Class instance with Class.forName("package.app.MyClass)") I have a runtime exception:
    java.lang.ClassNotFoundException: com.unisys.ebs.all.ispecs.GD130IspecModel
         at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:183)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:294)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:310)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:115)
         at com.unisys.util.ObjectLoader.load(ObjectLoader.java:60)
         at com.unisys.jellybeans.IspecFactory.getIspec(IspecFactory.java:74)
         at com.unisys.jellybeans.LINCEnvironment.getIspec(LINCEnvironment.java:1012)
         at com.unisys.ebs.middleware.TestLinc.initConnection(TestLinc.java:52)
         at com.unisys.ebs.middleware.TestLinc.main(TestLinc.java:106)
    but if instead of this I instantiate the class calling the constructor and writing an import sentence, it works fine. I really need to instantiate this class via Class.forName because it extends a superclass and know the class to instantiate only at runtime. I will appreciate any help. Thanks.
    Pablo Antonioletti

    I removed the import in the file header and wrote this code:
    try{           
    ispecModel = new com.unisys.ebs.all.ispecs.GD130IspecModel();
    Class ispecClass = Class.forName("com.unisys.ebs.all.ispecs.GD130IspecModel.class");
    catch(Exception e)
    e.printStackTrace();
    the new sentence work fine, if write mor code I can access methods and members. When the runtime execute the Class.forName sentence the exception is thrown. I put all in the same file and class to avoid mistakes typing class path.
    This is very rare I never seen it before and I developed java application since five years ago.

  • How can i run a special name method of class?

    i dynamic created a obj
    and i don't know the method of class,
    so i use a String parameter as the method's name
    but how can i run the method?
    please give me a copy of code, thanks!

    import java.lang.reflect.Method;
    public class unknown{
         public static void main(String[] args){
              unknown thisObj = new unknown();
              Class thisClass = thisObj.getClass();
              // calling the method()
              try{
                   Class[] allParamatersType = {};
                   Method mth = thisClass.getDeclaredMethod("method", allParamatersType);
                   String returnCallingAdd = (String)mth.invoke(thisObj, null);
                   System.out.println("calling add() : " + returnCallingAdd);
              catch(Exception ex){
                   ex.printStackTrace();
              // calling the method(int , string)
              try{
                   String firstValue = "Testing";
                   Class[] allParamatersType = { firstValue.getClass() };
                   Object[] values = { firstValue };
                   Method mth = thisClass.getDeclaredMethod("method", allParamatersType);
                   String returnCallingAdd = (String)mth.invoke(thisObj,values );
                   System.out.println("calling add() : " + returnCallingAdd);
              catch(Exception ex){
                   ex.printStackTrace();
         public String method(){
              return "method() called";     
         public String method(String two){
              return "method(String) called";     

  • Calling a method in another JVM instance

    I know you can use RMI to call the methods from classes across the network, but if the class is on the same machine, just in another JVM instance, is there a way to bypass the network layer and have the JVMs communicate directly with each other?

    Its not so much the overhead, as having the
    flexibility, to not have to modify firewall rules
    which disallow loop back traffic and most other non
    http (port 80) traffic if the production server is
    set up that way.You're coding to interfaces anyway, have a factory return either an RMI object which does the actual RMI work, or just a vanilla one if you're just running locally. As far as I know, there isn't a way to entirely circumvent the socket layer with RMI. Anyone know any different?

Maybe you are looking for

  • Higher Education cess not displayed in J2I6 when posted through J1IH

    Hi, We have passed an Excise JV through J1IH. BED, ECess and HECess accounts are credited and Excise Duty paid A/c is debited. All the values are posted properly. We have also checked the accounting document for this. But when we run the report J2I6

  • Want to change image properties programmatically

    want to change image properties programmatically like adjust_to_fit,selection_rectangle,pane,show_pallete. Reply as soon as possible. [email protected]

  • Trying to better understand L2 cache

    What would more L2 cache (in the higher end editions of the MacBook Pro) really get you? Are there certain situations or use cases that would benefit most from having more L2 cache? Ryan

  • JCo APIs fail with Message Server

    Hi Experts, I use JCo 2.0 to interact with SAP System via Message Server. When My application try to connect, it's generated this error: Connect_PM  MSHOST=HOST, R3NAME=XYZ, GROUP=GROUP ERROR       service 'sapmsXYZ' unknown TIME        Tue May 19 15

  • POI HSSF WDWebResource

    my requirement is not output any xml and xls file, but byte to bind to the WDWebResource for FileDownload below is my code that output physical file tm.xml and convert to physical file tm.xls i dont want this file to store but just keep it in memory