Expose Java applet method through WebMethod
-
I need to call a method on a Java applet and return that value, a string, via a WebService method. I can get the value from the applet via Javascript, but I'm not sure how to do this in the web service. I've tried using HttpWebRequest/Response to load a page, which loads the applet and stores the returned value in a hidden textbox, but it doesn't seem to execute the Javascript.
-
I need to call a method on a Java applet and return that value, a string, via a WebService method. I can get the value from the applet via Javascript, but I'm not sure how to do this in the web service. I've tried using HttpWebRequest/Response to load a page, which loads the applet and stores the returned value in a hidden textbox, but it doesn't seem to execute the Javascript.
Hi there, You simply make a http request to the server and read the result sent back with the HttpWebRequest/Response objects, and these objects certainly do not run javascript contained in the result html markups. If you want to execute the script, you might consider using the MSHTML[^] component. So in addition to using the HttpWebRequest/Response objects, you can also host the web browser[^] control in your application, and the control is responsible for loading the page and executing javascript.
-
Hi there, You simply make a http request to the server and read the result sent back with the HttpWebRequest/Response objects, and these objects certainly do not run javascript contained in the result html markups. If you want to execute the script, you might consider using the MSHTML[^] component. So in addition to using the HttpWebRequest/Response objects, you can also host the web browser[^] control in your application, and the control is responsible for loading the page and executing javascript.
Thanks for the reply, but I was thinking more along the lines of: Application <-> Web Service <-> Applet I can't instantiate the MSHTML component from within the web service, because it's not an single-threaded apartment.