Loading ...
Sorry, an error occurred while loading the content.

Re: [soaplite] Exporting variables from server to the service script

Expand Messages
  • Jay A. Kreibich
    ... The stub you have marked DEMO script is not a separate script, it is a package. It is more or less use ed (i.e. use Demo; ) by the dispatcher and
    Message 1 of 2 , Jul 7, 2006
    • 0 Attachment
      On Fri, Jul 07, 2006 at 09:27:03AM -0000, thelastcondor2 scratched on the wall:
      > Hi, i'm wondering if it's possible, and if yes how, to export
      > variables from the dispatching script, to the dispatched service,
      > without go trought ENV.
      > Something that look this way:
      > The dispatching script
      >
      > use SOAP::Transport::HTTP;
      > $VALUE={"x"=>"hello"};
      > SOAP::Transport::HTTP::CGI
      > -> dispatch_to('Demo')
      > #make visible $VALUE to the dispatched script
      > -> handle;
      >
      > The 'DEMO' script:
      >
      > package Demo;
      > sub demo {
      > $x=$VALUE{"x"};
      > ....
      > #return something
      > }

      The stub you have marked "'DEMO' script" is not a separate script, it
      is a package. It is more or less "use"ed (i.e. "use Demo;") by the
      dispatcher and loaded into the same interpreter as the dispatch
      part of the script. This means that the Demo package can access
      any global variables defined in the dispatch section.

      In other words, what you have here-- as written-- should more or less
      work. Of course, you should be doing a "use strict" in every
      package, which makes you have to declare and reference some of
      these a bit more carefully, but the basic idea is the same.

      -j

      --
      Jay A. Kreibich | CommTech, Emrg Net Tech Svcs
      jak@... | Campus IT & Edu Svcs
      <http://www.uiuc.edu/~jak> | University of Illinois at U/C
    Your message has been successfully submitted and would be delivered to recipients shortly.