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

SOAP::Lite & IO:;Socket::SSL

Expand Messages
  • jrmosier3
    Anyone else having issues with running a script with SOAP::Lite and IO::Socket::SSL modules simultaeously? My script needs a seperate SSL socket (non-SOAP) to
    Message 1 of 1 , Jan 11, 2005
    View Source
    • 0 Attachment
      Anyone else having issues with running a script with SOAP::Lite and
      IO::Socket::SSL modules simultaeously?

      My script needs a seperate SSL socket (non-SOAP) to communicate with
      while having the SOAP interface open too. Either one works well
      alone, but neither when loading both modules.

      I suspect that the https in the proxy address of the SOAP object is
      loading IO::Socket::SSL or something similar that is causing the
      conflict.

      Any advice is greatly appreciated.

      Code Sample:

      use strict;
      use SOAP::Lite;
      use IO::Socket::SSL qw(debug1);

      sub wsLogin {
      my $username = SOAP::Data->name('username' => $wsUser);
      my $password = SOAP::Data->name('password' => $wsPass);
      $auth = SOAP::Lite
      -> proxy( 'https://server/Ws/AuthenticationService' )
      -> uri( 'http://tempuri.org/' );
      my $securityToken = $auth->login( $username, $password )->result;
      my $info = SOAP::Lite
      -> proxy( 'https://server/Ws/CustomerInfoService',
      timeout => 900 )
      -> uri( 'http://tempuri.org/' );
      my $token = SOAP::Data->name('securityToken' => $securityToken);
      return( $info, $token );
      }

      sub sslSockConnect {
      my $server = shift;
      my $client = IO::Socket::SSL->new (
      PeerAddr => $server,
      PeerPort => $port,
      SSL_cipher_list => 'MEDIUM',
      SSL_key_file => 'client.key',
      SSL_cert_file => 'client.crt',
      SSL_use_cert => 1 );

      if( $client ) {
      $client->autoflush(1);
      if( $debug ) { print "Connected to $server\n"; }
      return( $client );
      }
      else { print "NO CLIENT FOR $server!\n"; }
      }
    Your message has been successfully submitted and would be delivered to recipients shortly.