[Israel.pm] SOAP in perl
bruck at actcom.net.il
Tue Jul 29 12:27:02 PDT 2008
And one more thing - you should mind data types.
Uri Bruck wrote:
> ik wrote:
>> I'm trying to send a soap xml to a .net soap server using perl (why
>> does .net have to use SOAP for such simple update ?! errr).
> It doesn't have to.
>> I found SOAP::Lite to be over complicated to my understanding, so I
>> tried to use LWP instead.
>> an example for what I'm doing is as follows:
>> sub send_content
>> my $content = shift or return 0;
>> my $ua = LWP::UserAgent->new;
>> # Create a request
>> my $req = HTTP::Request->new(POST => 'http://...../');
>> $req->header('SOAPAction' => '"http://tempuri.org/Save"');
>> $req->content_type('application/soap+xml; charset=utf-8');
>> #$req->content_type('text/xml; charset=utf-8');
>> # Pass request to the user agent and get a response back
>> my $res = $ua->request($req);
>> # Check the outcome of the response
>> if ($res->is_success)
>> return $res->content;
>> return 0;
>> I'm always having 500 error, and I wonder if anyone knows what am I
>> missing (the XML I'm sending seems to be valid according to the .net
> Would these be the .net people responsible for the server?
> If so, could you ask them for some log that shows what happens when the
> query reaches the server?
> Is your XML message style or RPC style?
> In the latter case, if you're miscalling the method, either by name or
> by signature, it could be the cause of the error.
> I don't think SOAP::Lite should be more complicated than generating your
> own XML message, quite the contrary, it's not the only option in Perl.
> There're also
> Most of my experience was with SOAP::Lite and I haven't had a chance to
> try those modules yet, but it might be worth your while to try that last
Si fractum non sit, noli id reficere.
More information about the Perl