Execute compiled code remotely

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • nano2k

    Execute compiled code remotely

    Hi

    I develop a client/server application using webservices.
    So, I have a client app and a webservice that responds to client app
    requests - nothin' new.
    In certain circumstances (namely, when importing data) I want some
    compiled code located in client app to be *transferred* to the
    webservice, optionally to make some bindings to the server side and to
    execute that code.

    More explicitly:
    The client app instantiates 2 types of objects that interract:
    1.
    class Client_B {
    public string ExecuteCommand( string sqlStatement) {
    //calls a webservice method that gets sqlStatement and executes it
    }
    }

    Client_B class gets an sql command (e.g.: "SELECT * FROM [someTable]")
    and then sends this command to the webservice (see ExecuteCommand( )
    method above). The ws executes the command against a database and
    returns the response.

    2.
    class Client_A {
    public Client_B m_myBroker;
    //...other members
    private void Insert(){
    //SOME LOGIC HERE - VERY IMPORTANT
    //...create the sql statement to insert a line in some table. e.g.:
    "INSERT INTO myTable (id,name) values (0, 'ABC')"
    m_myBroker.Exec uteCommand(myCo mmand);
    }
    }

    The scenario works very well except when bulk-inserting.
    When importing data, there are many records to insert. The data is
    provided as a file that resides on the client side. The user selects
    the file, than the client app reads it line-by-line, creates an object
    of type Client_A and calls Client_A.Insert () method. You see, this
    method has some logic there, like: adding 2 values and put the result
    as a value in INSERT statement.
    I want to transfer this logic to the webservice along with the import
    data (data read from import file), and execute it as it were executed
    on the client side. But faster, of course.

    Is it possible this scenario? Of course, I don't want to duplicate the
    logic inside Client_A.Insert () method.

    Thanks.

Working...