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

Re: [soaplite] Caching WSDL files...

Expand Messages
  • Nicholas Tang
    ARGH. I apologize. Figures - after wrestling with it for 2 hours, I figure it out 10 minutes after emailing the list. my $cookies =
    Message 1 of 3 , Oct 24, 2007
    • 0 Attachment
      ARGH. I apologize. Figures - after wrestling with it for 2 hours, I
      figure it out 10 minutes after emailing the list.


      my $cookies = HTTP::Cookies->new(ignore_discard => 1, hide_cookie2 =>
      1, file => '/tmp/nscookies', autosave => 1);

      my $soap = NSConfigService
      -> proxy('http://10.50.0.1/soap/', cookie_jar=>$cookies)
      ;


      I didn't realize you could pass all of the standard SOAP::LITE
      options. Once I did that, and used the cookie_jar, it worked.
      Whoops.

      Apologies, but hopefully it'll help the next person that gets confused. :)

      Nicholas
    • Nicholas Tang
      Here s what I ended up doing, which is working beautifully and is a lot more clever ... #!/usr/bin/perl -w use HTTP::Cookies; use Getopt::Long; use lib
      Message 2 of 3 , Oct 31, 2007
      • 0 Attachment
        Here's what I ended up doing, which is working beautifully and is a
        lot more "clever"...

        #!/usr/bin/perl -w

        use HTTP::Cookies;
        use Getopt::Long;
        use lib qw(/usr/local/bin);
        use SOAP::Lite;

        my $cookies = HTTP::Cookies->new(ignore_discard => 1, hide_cookie2 =>
        1, autosave => 1);

        # Optionally, set default inline username and password here - I
        recommend a read-only account!
        my $username = '';
        my $password = '';
        my $debug = 0;
        my $soap;

        eval {
        require NSConfigService;
        };
        if ($@) {
        print "\nNo cache file found! Parsing the Netscaler wsdl... (this
        can take a while...)\n";
        $soap = SOAP::Lite
        -> cache_dir("/usr/local/bin")
        -> service('file:./NSConfig.wsdl')
        -> proxy('http://10.50.0.1/soap/', cookie_jar=>$cookies)
        ;
        }
        else {
        import NSConfigService;
        $soap = NSConfigService
        -> proxy('http://10.50.0.1/soap/', cookie_jar=>$cookies)
        ;
        }

        GetOptions (
        "username=s" => \$username,
        "password=s" => \$password,
        );


        etc. etc. etc.

        On 10/24/07, Nicholas Tang <nicholastang@...> wrote:
        > ARGH. I apologize. Figures - after wrestling with it for 2 hours, I
        > figure it out 10 minutes after emailing the list.
        >
        >
        > my $cookies = HTTP::Cookies->new(ignore_discard => 1, hide_cookie2 =>
        > 1, file => '/tmp/nscookies', autosave => 1);
        >
        > my $soap = NSConfigService
        > -> proxy('http://10.50.0.1/soap/', cookie_jar=>$cookies)
        > ;
        >
        >
        > I didn't realize you could pass all of the standard SOAP::LITE
        > options. Once I did that, and used the cookie_jar, it worked.
        > Whoops.
        >
        > Apologies, but hopefully it'll help the next person that gets confused. :)
        >
        > Nicholas
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.