Calling CGI script ("web service") from .NET

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tibor
    New Member
    • Feb 2008
    • 1

    Calling CGI script ("web service") from .NET

    Hi, I need to call a CGI script which should be a web service from .NET environment.

    I got an example in perl but I'm unable to trasform it into .NET (C#). Can anybody help me with this?
    Code:
    use SOAP::Lite;
    
    die "Usage: perl call-ws.pl file.xml\n" unless $ARGV[0];
    open F,$ARGV[0] || die "Could not read file $ARGV[0]\n";
    my $val ="";
    while (<F>) {
            $val.= $_;
            }
    close F;
    
    $val =  SOAP::Lite
            -> proxy('http://212...../Xml/external.cgi')
            ->outputxml('1')
            ->uri(AdXML)
            ->XMLrequest("domain?", "username", "password", $val);
    
    sub SOAP::Transport::HTTP::Client::get_basic_credentials { 
       return 'username' => 'password';
    }
    
    
    $val =~s/>/>\n/g;
    $val =~ s/\&amp;/\&/g;
    $val =~ s/\&lt;/</g;
    $val =~ s/\&gt;/>/g;
    
    print "Server response =$val\n";
    Thanks
Working...