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

Calling one method from another module

Expand Messages
  • Gavin Hamill
    Hullo :) I ve developed some modules based on the tutorial at http://www.perl.com/pub/a/2001/04/24/soap.html using their Ticket-based authentication as a
    Message 1 of 1 , Sep 19, 2003
    • 0 Attachment
      Hullo :)

      I've developed some modules based on the tutorial at
      http://www.perl.com/pub/a/2001/04/24/soap.html using their 'Ticket-based
      authentication' as a base...

      I'm now able to write clients which call the login() method and pass a
      username/password pair, and get a session token back. My server-side methods
      then use this fragment

      sub methodName {
      my $self = shift; # First arg is name of module
      my $session = pop->valueof('//authInfo'); # last arg contains SOAP Header
      my $validity = $checkAuthInfo->($session);

      <main module code>
      }

      I include a checkAuthInfo inside each of the .pm files I despatch the incoming
      SOAP requests to.

      What I'd like to do, however, is call a method from another module whilst
      inside an existing method. e.g. 'addNewSystemUser' would automatically call
      'addMailbox', 'addFTPAccount' etc.

      but I can't figure it out... if I simply add in a new section to 'methodName'
      of

      my $soap = SOAP::Lite -> uri('DHCP') -> proxy('http://127.0.0.1:81/');
      my $authInfo = SOAP::Header->name(authInfo => $session);
      my $result= $soap->getLeaseSettings($authInfo);
      print $result->result;

      and call that code, then the server just hangs :( If I put on SOAP::Lite
      +trace qw(debug); I can see the output of the client request, but nothing
      comes back from the server. If I put some print statements into the server
      getLeaseSettings method, I never see anything printed...

      Calling the getLeaseSettings method is working fine from a simple standalone
      'client.pl' ....

      If anyone could suggest something, I'd be very grateful!

      Cheers,
      Gavin.
    Your message has been successfully submitted and would be delivered to recipients shortly.