And here is the createEnvelope function:

#
# Functions listed below are internal to the creation of the custom
SOAP requests.
#
sub createEnvelope  {

  my $action = shift;
  my $namesp = shift;
  my $params = shift;

  my $soap = '<?xml version="1.0" encoding="utf-8"?>
              <soap:Envelope xmlns:xsi="http://www.w3.org/2001/
XMLSchema-instance"
                xmlns:xsd="http://www.w3.org/2001/XMLSchema";
                xmlns:soap="http://www.w3.org/2003/05/soap-envelope";>
              <soap:Body>';
  $soap .= '<' . $action . ' xmlns="' . $namesp . '">';
  $soap .= parseParams($params);
  $soap .= '</' . $action . '></soap:Body></soap:Envelope>';

  return $soap;
}  # end createEnvelope()


sub parseParams {

  my $params = shift;
  my $plist = '';

  while (my ($key, $value) = each(%{$params})) {
    $plist .= '<' . $key . '>' . $value . '</' . $key . '>';
  }
  return $plist;
}  # end parseParams()


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to