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

URJENT -- Please help -------- SoapLite problem with Cookie Authe ntication.

Expand Messages
  • Sinha, Madhukar [IT]
    Any suggestions are welcome. Paul, please help. Thanks ... From: Sinha, Madhukar [IT] Sent: Wednesday, July 24, 2002 2:59 PM To: soaplite@yahoogroups.com
    Message 1 of 1 , Jul 31, 2002
    • 0 Attachment
      Any suggestions are welcome.

      Paul, please help.

      Thanks

      -----Original Message-----
      From: Sinha, Madhukar [IT]
      Sent: Wednesday, July 24, 2002 2:59 PM
      To: soaplite@yahoogroups.com
      Subject: [soaplite] SoapLite problem with Cookie Authentication.



      Hi All,

      I having a problem using cookies based authentication with SOAP::Lite. My
      service is in Java using Apache Soap2.2. (java client works fine using
      cookies)
      Authentication works fine and i store the cookie in a file and then in my
      soap lite call i try to load it from that file. (as mentioned in cookbook)
      The call also goes fine and i get XML back but in incorrect format.

      I get client warnings in Trace , ALso i can see my response "hello world"
      (e.g hibye.cgi is one server side) coming back in XML response , but i am
      unable to read it normally as i also get an error " Unexpected Content-Type
      '' returned"

      I am using cookie because , Single Sign on -software protects our webservers
      here is the code, HTTP library file, trace and also cookie file generted

      Please let me know if you can find out the reason for this problem.. Thanks
      a lot in advance...

      client code
      ----------------------------------------------------------------------------
      ----------------------------------------------------------------------------
      -----------------------------------

      require 'http-lib.pl' || die "Cannot get http-lib.pl -$!";
      use SOAP::Lite +trace =>all;
      #use SOAP::Lite;
      use HTTP::Cookies;


      $HOSTNAME = "webgmsn1d.ny.ssmb.com";
      $URL = "/siteminderagent/forms/login.fcc";
      $PORT = 10002;
      $reqURI = "/index.html";
      #$reqURI = "/cgi-bin/hibye.cgi";
      $reqURL = "http://webgmsn1d.ny.ssmb.com:10002$reqURI";
      $requestedURL = &urlEncode($reqURL);
      $IN =
      "USER=username&PASSWORD=password&SMAUTHREASON=0&TARGET=$requestedURL";
      #print "$IN\n";
      $smCookies = "Cookie:SMCHALLENGE=YES; path=/; domain=.ssmb.com\n";
      $buf = &HTTPPost($URL, $HOSTNAME, $PORT, $IN, '');
      # print "$buf";
      if ($buf =~ /(Set-cookie.*)/){
      $tmp = $1;
      }
      if ($buf =~ /(location.*)/i){
      $loc = $1;
      }
      $smCookies = "$tmp\n";
      $smCookies =~ s/Set\-//g;

      # print "111-$tmp\n222-$loc\n";

      $buf = &HTTPGet($reqURI, $HOSTNAME, $PORT, '', '');
      # print "$buf\n";
      if ($buf =~ /(Set-Cookie: SMSESSION.*)/){
      $tmp = $1;
      }
      if ($buf =~ /(Set-Cookie: FORM.*)/){
      $tmp2 = $1;
      }
      if ($buf =~ /(location.*)/i){
      $loc = $1;
      }
      $smCookies = "$tmp2\n$tmp\n";
      $smCookies =~ s/Set\-Cookie/Set\-Cookie3/g;

      # print "333-$tmp\n444-$loc\n";
      #print "Content-Type: text/html\n\n";
      $file = "cook";
      open(FILE, ">$file") or die "Can't open $file: $!";
      print FILE "#LWP-Cookies-1.0\n";
      print FILE "$smCookies";
      close(FILE);

      print SOAP::Lite
      -> uri('http://webgmsn1d.ny.ssmb.com:10002/Demo')
      -> proxy('http://webgmsn1d.ny.ssmb.com:10002/cgi-bin/hibye.cgi',
      cookie_jar => HTTP::Cookies->new(file => './cook'))
      -> on_fault(sub { my($soap, $res) = @_; die ref $res ? $res->faultstring :
      $soap->transport->status, "\n"; })
      -> hi()
      -> result;


      sub urlEncode
      {
      my $inarg = $_[0];

      $inarg =~ s/([^a-zA-Z0-9 _])/"%" . uc(unpack (H2, $1))/eg;
      $inarg =~ s/ /+/g;

      return $inarg;
      }

      ----------------------------------------------------------------------------
      ----------------------------------------------------------------------------
      -----------------------------------

      trace
      ----------------------------------------------------------------------------
      ----------------------------------------------------------------------------
      -----------------------------------
      SOAP::Transport::new: ()
      SOAP::Serializer::new: ()
      SOAP::Deserializer::new: ()
      SOAP::Parser::new: ()
      SOAP::Lite::new: ()
      SOAP::Transport::HTTP::Client::new: ()
      SOAP::Lite::call: ()
      SOAP::Serializer::envelope: ()
      SOAP::Serializer::envelope: hi
      SOAP::Data::new: ()
      SOAP::Data::new: ()
      SOAP::Data::new: ()
      SOAP::Data::new: ()
      SOAP::Transport::HTTP::Client::send_receive: HTTP::Request=HASH(0x398d40)
      SOAP::Transport::HTTP::Client::send_receive: POST
      http://webgmsn1d.ny.ssmb.com:10002/cgi-bin/hibye.cgi
      Accept: text/xml
      Accept: multipart/*
      Content-Length: 461
      Content-Type: text/xml; charset=utf-8
      SOAPAction: "http://webgmsn1d.ny.ssmb.com:10002/Demo#hi"

      <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope
      xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
      xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:xsd="http://www.w3.org/1999/XMLSchema"
      SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><n
      amesp1:hi
      xmlns:namesp1="http://webgmsn1d.ny.ssmb.com:10002/Demo"/></SOAP-ENV:Body></S
      OAP-ENV:Envelope>
      SOAP::Transport::HTTP::Client::send_receive: HTTP::Response=HASH(0x3adf8c)
      SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 200 OK
      Date: Wed, 24 Jul 2002 18:39:36 GMT
      Server: Netscape-Enterprise/4.1
      Client-Date: Wed, 24 Jul 2002 18:39:36 GMT
      Client-Peer: 162.124.158.29:10002
      Client-Warning: Illegal header '/export/enterprise-docs/ficash/lib/perl5:
      /export/enterprise-docs/ficash/lib/perl5/Modules::/opt/sybperl/lib/site_perl
      ::/export/enterprise-docs/ficash/lib/perl5/Modules/SoapLite'
      Set-Cookie:
      SMSESSION=lxNRkjklCwua1FFR9lErGfr2WZL00WB5OVhC54/jv8LCgNpc4fGCpjahguq+5oD3em
      O9wlPno9iHUH77k7sKvPbbh1Vi3W5hf2+QRbQ/MC43ps2bgS/Jx3e6WZ03KjWIVMrcJ6RPJUxJfS
      muXHDI7Xjsi7Yu5irpSRC0j+aAybOdRDI6E3WnnfI6zagKk3weRRr3cXhYL1EPIMAhd+nLuAKojl
      o/vXAFd+27POQivW9qdpCQimfBwoFYVICC/jHfjN5QZjYSw9uvtKqpR40vFklmU8aEb23Ycaolpy
      ud8s8pF1vWpGXYAm+DGFNig+Jt5gtrn6jSeryF5d/NQCnCOyhONl6jvlchZ98dtcU/b2l7QY185g
      ot3hDA8g3p8VKVKgylwuTiLeggc4jlO9BQrF4+6IgzY+qlx7jibCMqNPPuyQOpN10L8ZxXNKhHDs
      zw6NY9pcFiivZYjpMSQKNYILiqLMItMY3ngb0E+3GdOtJbnUVbnUnNgP9AyWHeyWmi36kNIbA+Q1
      Qp1C7Ww+W9WqgSFdIuJLG9v7lV9/DHwViPdmvRMu54SKz1cAmyuxoai+eUNnwmHX8JYfoLPP9oJw
      uqfA+oIlMlW9MMfompedP6oza1EwRD9a/0+ni1e00pLz1eLPsg3oK+uPR4OmYkZR2Uagzz2cwD9j
      P45R55NZztPk5snMiJ+v4xtH5SvKQABWhjndiQceG/s4hjexJcC56BZPiOJraNHnf4BWLz7eaP5X
      8+R/D1Jl+khAuClQHIgb10I6nQ1HDPzFgGRnA6MHGpwxQph6MzFPOdSgf12PfdzL4/Y352s4LGBl
      6GShOe/sJDILRCRYA9T4UnrDr00RV7joUlC4Sg/alEPbdwAvUTGoLssdwvdsmb711m28TdMNZ0VR
      4nAw+PTG0al/ONFA==; path=/; domain=.ssmb.com

      /export/enterprise-docs/ficash/lib/perl5:
      /export/enterprise-docs/ficash/lib/perl5/Modules::/opt/sybperl/lib/site_perl
      ::/export/enterprise-docs/ficash/lib/perl5/Modules/SoapLite
      Content-type: text/xml; charset=utf-8
      Soapserver: SOAP::Lite/Perl/0.55
      Content-length: 546
      Connection: close

      <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope
      xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
      xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:xsd="http://www.w3.org/1999/XMLSchema"
      SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><n
      amesp1:hiResponse
      xmlns:namesp1="http://webgmsn1d.ny.ssmb.com:10002/Demo"><s-gensym3
      xsi:type="xsd:string">hello,
      world</s-gensym3></namesp1:hiResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
      Unexpected Content-Type '' returned
      SOAP::Lite::DESTROY: ()
      SOAP::Deserializer::DESTROY: ()
      SOAP::Parser::DESTROY: ()
      SOAP::Transport::DESTROY: ()
      SOAP::Transport::HTTP::Client::DESTROY: ()
      SOAP::Serializer::DESTROY: ()
      SOAP::Data::DESTROY: ()
      SOAP::Data::DESTROY: ()
      SOAP::Data::DESTROY: ()
      SOAP::Data::DESTROY: ()
      ----------------------------------------------------------------------------
      ----------------------------------------------------------------------------
      -----------------------------------

      cookie file "cook" generated--
      ----------------------------------------------------------------------------
      ----------------------------------------------------------------------------
      -----------------------------------
      #LWP-Cookies-1.0
      Set-Cookie3: FORMCRED=; path=/; expires=Fri, 25-Jan-2002 18:39:35 GMT;
      domain=.ssmb.com
      Set-Cookie3:
      SMSESSION=k5OwMIEo3jeVodta6oGXeisbnhVuxe8KFLvMCUqDnHDuQ6q2bNJNZvwvw8HM3/X/96
      +p7g4Vvo2v1Dg/fLQO24JZ4Qi8PU8NGolGNYHqzRfLUx7vr6T7et6R8fpWBWMZ0RfDOpBTuL+26l
      agdJJ36Dt4syiw8LBtZUUzRd6C5r2hQ9upaMr6AjTUMULRtqqPHPqtVs9lREe6HzAA1UowAIyBi2
      SgZAVqDf24ILSxe/IJG4MMW5Vrp+ZZdPEm3JWktNeKpcmg2ptSgLJ6BQpxlJ279xLeVc8VBSCk1o
      blRLesRcs5cRcwjs5WU2NTm3wqFLgFQMsfhbQvBN4k5NfVi04BqoZ+M8dcvuEVVY0QeatdSUSAXw
      xyk8CAQor/dSo4jlf7ivt9owiRUdi44kYOcT8AN5+UcbHTCIRw9tK1RS6ftVXvhN2prk+c2S1Ueu
      UIndsAOeQfE1LBfK5yCIyTV+BvH/U36vHBGKcexGLq4LaNPt/LUevbpCGu358gkTQmp8bPH2eN6S
      P9nK+dxjvHbq1zfNY4CLB2ZWkzXVrOHQDqXC4FUCDPjoeN3aTsQpz8GN6XEfuJvRqxMleQBlU0Dh
      6BBGugjL/T1aiT+8Cp5n9THATVBWHUMc3QaxrOJIp4GfjWD0HMQe4AnoQAo3kqbnZmnR17g4af17
      u/ELK+ixKMTqr9kq+OhH/CNBHH/9qgi1FH9tX4YgK/DLsisaWvU95N+ZCOqcXTlBKiqjE8naBZBG
      cP39GvP7eL6sxsJ+Mz2yoTHZ1t9kKRAlg4GdDwR1sHYl+JoGgoNXRInFTgI8rq/sM4p88bSBKzRI
      xYyS3hL+7VA3c97ps1IWnVJn5EbJV7JPwP1+6uL2zC3QA6u6ILhx2ZatXuGFR/8x38TU+GoBNQGT
      sxhBxo/lDq7FVdfA==; path=/; domain=.ssmb.com
      ----------------------------------------------------------------------------
      ----------------------------------------------------------------------------
      -----------------------------------


      http-lib.pl
      ----------------------------------------------------------------------------
      ----------------------------------------------------------------------------
      -----------------------------------

      #!/opt/tfidrv/perl5/bin/perl
      #ident "%W%"
      #
      # "@(#)http-lib.pl 1.2 10/22/99 18:10:15 SBS"
      #
      # Instant Web Scripts with CGI Perl
      # By Selena Sol
      #
      # http://www.extropia.com/books/instant_web_scripts/chap08.html
      # http://www.extropia.com/Scripts/Source/Library/Http/http-lib.pl.txt
      #

      ############################################################
      # HTTP_LIB.PL
      #
      # This script was written by Gunther Birznieks.
      # Date Created: 5-15-96
      #
      # You may copy this under the terms of the GNU General Public
      # License or the Artistic License which is distributed with
      # copies of Perl v5.x for UNIX.
      #
      # Purpose: Provides a set of library routines to connect as
      # a browser to another HTTP site and then return the results to
      # the caller.
      #
      # Main Procedures:
      # HTTPGet - Gets a URL using the GET Method
      # HTTPPost - Gets a URL using the POST Method
      #
      # Set the $http_os variable equal to NT if you are on Windows NT perl
      # Set it to UNIX for normal UNIX operations.
      #
      # If you do not have a version of PERL with the Socket.pm, you
      # can manually define $AF_INET and $SOCK_STREAM to 2 and 1 respectively.
      # On some systems, SOCK_STREAM may be 2.
      #
      ############################################################

      # Use the Sockets library for TCP/IP Communications
      use Socket;
      $http_os = "UNIX";

      $TIMEOUT = 3600; # in seconds

      ############################################################
      #
      # subroutine: HTTPGet
      # Usage:
      # $buf = &HTTPGet("/index.html", "www.eff.org", 80,
      # "var1=value1&var2=value2&etc=etc", "c2IxNTk0MzpzYjkxNTk0Mw==");
      #
      # Parameters:
      # $url = URL To Connect To Relative to the host
      # $hostname = HostName of WebSite to Connect To
      # $port = port to connect to (normally 80)
      # $in = Form Values To Mimic sending to the site
      # $auth = Base64-encoded authorization string (can be empty)
      #
      # Output:
      # HTML Code Output from the Web Server.
      #
      ############################################################

      sub HTTPGet {
      local($url, $hostname, $port, $in, $auth) = @_;
      local($form_vars, $x, $socket);
      local ($buf);
      $socket = &OpenSocket($hostname, $port);


      $form_vars = &FormatFormVars($in);
      # we need to add the ? to the front of the passed
      # form variables
      $url .= "?" . $form_vars;

      # set up authorization string, if present
      if ($auth) {
      $auth = "Authorization: Basic " . $auth . "\n";
      }

      # The following sends the information to the HTTP Server.
      print $socket <<__END_OF_SOCKET__;
      GET $url HTTP/1.0
      Accept: text/html
      Accept: text/xml
      Accept: text/plain
      User-Agent: Mozilla/1.0
      ${smCookies}${auth}

      __END_OF_SOCKET__

      # RetrieveHTTP retrieves the HTML code
      $buf = &RetrieveHTTP($socket);
      $buf;

      } #end of HTTPGet

      ############################################################
      #
      # subroutine: HTTPPost
      # Usage:
      # $buf = &HTTPPost("/index.html", "www.eff.org", 80,
      # "var1=value1&var2=value2&etc=etc", "c2IxNTk0MzpzYjkxNTk0Mw==");
      #
      # Parameters:
      # $url = URL To Connect To Relative to the host
      # $hostname = HostName of WebSite to Connect To
      # $port = port to connect to (normally 80)
      # $in = Form Values To Mimic sending to the site
      # $auth = Base64-encoded authorization string (can be empty)
      #
      # Output:
      # HTML Code Output from the Web Server.
      #
      ############################################################

      sub HTTPPost {
      local($url, $hostname, $port, $in, $auth) = @_;
      local($form_vars, $x, $socket);
      local ($buf, $form_var_length);

      $socket = &OpenSocket($hostname, $port);
      # The following sends the information to the HTTP Server.

      $form_vars = &FormatFormVars($in);

      # set up authorization string, if present
      if ($auth) {
      $auth = "Authorization: Basic " . $auth . "\n";
      }

      # We need the length of the form variables
      # that are passed to the server to pass as
      # content-length.
      $form_var_length = length($form_vars);
      print $socket <<__END_OF_SOCKET__;
      POST $url HTTP/1.0
      Accept: text/html
      Accept: text/xml
      Accept: text/plain
      User-Agent: Mozilla/1.0
      ${smCookies}${auth}Content-type: application/x-www-form-urlencoded
      Content-length: $form_var_length

      $form_vars
      __END_OF_SOCKET__

      $buf = &RetrieveHTTP($socket);
      $buf;

      } #end of HTTPPost

      ############################################################
      #
      # subroutine: FormatFormVars
      # Usage:
      # $formvars = &FormatFormVars($in);
      #
      # Parameters:
      # $in = form variables to process
      #
      # Output:
      # Processed form variables. Illegal characters
      # are replaced with their %Hexcode equivalents.
      # Currently the routine only handles spaces but
      # could be expanded for more.
      #
      ############################################################

      sub FormatFormVars {
      local ($in) = @_;

      $in =~ s/ /%20/g;

      $in;
      } # FormatFormVars

      ############################################################
      #
      # subroutine: RetrieveHTTP
      # Usage:
      # $buf = &RetrieveHTTP($socket_handle);
      #
      # Parameters:
      # $socket = Handle to the socket we are communicating
      # with
      #
      # Output:
      # Buffer containing the output of the HTTP Server
      #
      ############################################################

      sub RetrieveHTTP {
      local ($socket) = @_;
      local ($buf,$x, $split_length);

      $buf = read_sock($socket, $TIMEOUT);
      # if the buffer has a status code of 200 in it,
      # then we know its safe to read in the rest of the document

      if ($buf =~ /200/) {
      while(<$socket>) {
      $buf .= $_;
      }
      }

      # We strip off the HTTP header by looking for
      # two newlines or two newlines preceeded with
      # carriage returns. Different Web Servers use
      # different delimiters sometimes.
      #
      $x = index($buf, "\r\n\r\n");
      $split_length = 4;

      if ($x == -1) {
      $x = index($buf, "\n\n");
      $split_length = 2;
      }
      #
      # The following actually splits the header off
      if ($x > -1) {
      # $buf = substr($buf,$x + $split_length);
      }

      close $socket;

      $buf;
      } # End of RetrieveHTTP

      ############################################################
      #
      # subroutine: OpenSocket
      # Usage:
      # $socket_handle = &OpenSocket($host, $port);
      #
      # Parameters:
      # $host = host name to connect to
      # $port = port to connect to
      #
      # Output:
      # Handle to socket that was opened
      #
      ############################################################

      sub OpenSocket {
      local($hostname, $port) = @_;

      local($ipaddress, $fullipaddress, $packconnectip);
      local($packthishostip);
      local($AF_INET, $SOCK_STREAM, $SOCK_ADDR);
      local($PROTOCOL, $HTTP_PORT);

      # The following variables are set using values defined in
      # The sockets.pm library. If your version of perl (v4) does
      # not have the sockets library, you can substitute some
      # default values such as 2 for AF_INIT, and 1 for SOCK_STREAM.
      # if 1 does not work for SOCK_STREAM, try using 2.
      #
      # AF_INET defines the internet class of addressing
      #
      # SOCK_STREAM is a variable telling the program to use
      # a socket connection. This varies from using SOCK_DGRAM
      # which would send UDP datagrams using a connectionless paradigm
      # instead.
      #
      # PROTOCOL is TCPIP (6).
      #
      # PORT Should generally be 80 for HTTP Access, some sites use
      # alternative ports such as 8080.
      #
      # SOCK_ADDR is the packeted format of the full socket address
      # including the AF_INIT value, HTTP_PORT, and IP ADDRESS in that order
      #

      $AF_INET = AF_INET;
      $SOCK_STREAM = SOCK_STREAM;

      $SOCK_ADDR = "S n a4 x8";

      # The following routines get the protocol information
      #

      $PROTOCOL = (getprotobyname('tcp'))[2];

      $HTTP_PORT = $port;
      $HTTP_PORT = 80 unless ($HTTP_PORT =~ /^\d+$/);
      $PROTOCOL = 6 unless ($PROTOCOL =~ /^\d+$/);

      # Ip address is the Address of the host that we need to connect
      # to
      $ipaddress = (gethostbyname($hostname))[4];

      $fullipaddress = join (".", unpack("C4", $ipaddress));

      $packconnectip = pack($SOCK_ADDR, $AF_INET,
      $HTTP_PORT, $ipaddress);
      $packthishostip = pack($SOCK_ADDR,
      $AF_INET, 0, "\0\0\0\0");

      # First we allocate the socket
      socket (S, $AF_INET, $SOCK_STREAM, $PROTOCOL) ||
      &web_error( "Can't make socket:$!\n");

      # Then we bind the socket to the local host
      bind (S,$packthishostip) ||
      &web_error( "Can't bind:$!\n");
      # Then we connect the socket to the remote host
      connect(S, $packconnectip) ||
      &web_error( "Can't connect socket:$!\n");

      # The following selects the socket handle and turns off
      # output buffering
      #
      select(S);
      $| = 1;
      select (STDOUT);

      S;
      } # End of OpenSocket

      ############################################################
      #
      # subroutine: read_sock
      # Usage:
      # &read_socket(SOCKET_HANDLE, $timeout);
      #
      # Parameters:
      # SOCKET_HANDLE = Handle to an allocated Socket
      # $timeout = amount of time read_sock is allowed to
      # wait for input before timing out
      # (measured in seconds)
      #
      # Output:
      # Buffer containing what was read from the socket
      #
      ############################################################

      sub read_sock {
      local($handle, $endtime) = @_;
      local($localbuf,$buf);
      local($rin,$rout,$nfound);

      # Set endtime to be time + endtime.
      $endtime += time;

      # Clear buffer
      $buf = "";

      # Clear $rin (Read Input variable)
      $rin = '';
      # Set $rin to be a vector of the socket file handle
      vec($rin, fileno($handle), 1) = 1;

      # nfound is 0 since we have not read anything yet
      $nfound = 0;

      # Loop until we time out or something was read
      read_socket:
      while (($endtime > time) && ($nfound <= 0)) {
      # Read 1024 bytes at a time
      $length = 1024;
      # Preallocate buffer
      $localbuf = " " x 1025;
      # NT does not support select for polling to see if
      # There are characters to be received. This is important
      # Because we dont want to block if there is nothing
      # being received.
      $nfound = 1;
      if ($http_os ne "NT") {
      # The following polls to see if there is anything in the input
      # buffer to read. If there is, we will later call the sysread routine
      $nfound = select($rout=$rin, undef, undef,.2);
      }
      }

      # If we found something in the read socket, we should
      # get it using sysread.
      if ($nfound > 0) {
      $length = sysread($handle, $localbuf, 1024);
      if ($length > 0) {
      $buf .= $localbuf;
      }
      }

      # Return the contents of the buffer
      $buf;
      }

      ############################################################
      #
      # subroutine: web_error
      # Usage:
      # &web_error("File xxx could not be opened");
      #
      # Parameters:
      # $error = Description of Web Error
      #
      # Output:
      # None
      #
      ############################################################

      sub web_error
      {
      local ($error) = @_;
      $error = "Error Occured: $error";
      print "$error<p>\n";

      # Die exits the program prematurely and prints an error to
      # stderr

      die $error;

      } # end of web_error

      1;

      ----------------------------------------------------------------------------
      ----------------------------------------------------------------------------
      -----------------------------------

      Please help me if you can identify the problem..


      Madhukar Sinha
      Citigroup Corporate & Investment Bank
      FI Derivatives Technology
      Tel : 212 816 2698
      Fax: 212 816 3325
      madhukar.sinha@...
    Your message has been successfully submitted and would be delivered to recipients shortly.