Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Expose Java applet method through WebMethod

Expose Java applet method through WebMethod

Scheduled Pinned Locked Moved ASP.NET
javajavascripttutorial
3 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    Glenn Dawson
    wrote on last edited by
    #1

    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.

    M 1 Reply Last reply
    0
    • G Glenn Dawson

      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.

      M Offline
      M Offline
      minhpc_bk
      wrote on last edited by
      #2

      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.

      G 1 Reply Last reply
      0
      • M minhpc_bk

        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.

        G Offline
        G Offline
        Glenn Dawson
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups