Jojoxx.net logotyp

 

 

Användare ikonAnvändare
Besökare just nu: 25
Snabblänkar ikonSnabblänkar
JavaScript-arkivet
Perl
FAQ

Sök på Jojoxx.net


FAQ: Perl / CGI

Hur postar man ett SOAP-meddelande till en .NET webservice?

use Encode;
use LWP::UserAgent;
use HTTP::Request;
$message="... your soap envelope goes here ...";
my $utf8message = encode("utf8", $message);
my $messagelength=length($utf8message);
my $userAgent = LWP::UserAgent->new();
my $request = HTTP::Request->new(POST => 'http://www.yourdomain.com/soapservice.asmx');
$request->header("SOAPAction" => '"http://www.yourdomain.com/YourSOAPAction"');
$request->header("Content-Type" => "text/xml; charset=utf-8");
$request->header("Host" => "www.yourdomain.com");
$request->header("Content-Length" => $messagelength);
$request->content($utf8message);
my $response = $userAgent->request($request);
print $response->as_string;

,