Note that there are some explanatory texts on larger screens.

plurals
  1. POC# Calling a method I dont yet know the name of yet? Reflection?
    text
    copied!<p>Suppose I have the following (rather common) model</p> <p>Client invokes web service request -> request added to server queue -> server invokes 3rd party app via web service -> 3rd party app notifies server that event processing is finished -> server notifies client that request is completed</p> <p>What I am wondering about is the 'server invokes 3rd party app via web service' stage. The 3rd party app exposes web service methods that are configured inside the application. For instance, I might create a method in this app called 'MultiplyByTwo'. Then I click 'GO' and it generates a web service with methods like BeginCalculateMultiplyByTwo and EndMultiplyByTwo (using the IAsync model). This is great.</p> <p>Now I am creating a queue object so that multiple clients can request this service and have the server queue them up for sequential execution. So this queue object will have a method like runNext() that will invoke the web service on the 3rd party app. This is great so long as I know the name of the methods that are being called (BegingCaculateMultiplyByTwo in this case), but what if I want to dynamically change the name of the method?</p> <p>So in the 3rd party app, I change my web service method and call it 'MultiplyByThree'. This will expose BeginMultiplyByThree and some other methods with a predictable naming scheme. How can I set my class up to dynamically call a method of which I dont yet know the name? </p> <p>Ideally if I could set the name of the method to be called in an app.config file that would be great. </p> <p>I suppose this is something I can achieve via reflection? </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload