perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kurt Hansen <>
Subject Re: Can't get SOAP to work under mod_perl
Date Thu, 18 Aug 2005 17:34:07 GMT
Steve Baker wrote:

> HTTP/1.1
> Accept: text/xml
> Accept: multipart/*
> Content-Length: 448
> Content-Type: text/xml; charset=utf-8
> SOAPAction: ""
> <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope
> xmlns:xsi=""
> xmlns:SOAP-ENC=""
> xmlns:SOAP-ENV=""
> xmlns:xsd=""
> SOAP-ENV:encodingStyle=""><SOAP-ENV:Body><namesp1:hi

> xmlns:namesp1=""/></SOAP-ENV:Body></SOAP-ENV:Envelope>

> SOAP::Transport::HTTP::Client::send_receive: HTTP::Response=HASH(0x18c18e4)
> SOAP::Transport::HTTP::Client::send_receive: HTTP/0.9 200 (OK) EOF
> Client-Date: Thu, 18 Aug 2005 16:22:41 GMT
> Client-Peer:
> Client-Response-Num: 1
> Can't call method "result" on an undefined value at ./ line 13.


Are you by chance communicating with a Windows server? I had problems 
communicating using SOAP with a Windows server, though I was able to 
communicate with other public services (see below for example code for 
ones I could get to work). I was given the following article which 
enabled me to finally get it to work:

The issue was with two things. One, I had to do something to "on_action" 
as noted below. The article has a different solution. Two, the Windows 
server did not like the XML that SOAP::Lite produced. Specifically, it 
was the data that the Windows server could not read. SOAP::Lite produced 
  XML that added a namespX: at the front of the data tag, e.g.

<namesp2:SOMENAME DATANAME xsi:type="xsd:string">data</DATANAME>

while the Windows server expected:

<DATANAME xsi:type="xsd:string">data</DATANAME>

Strangely enough, I can't re-create what was going wrong right now so 
what you see above is partially from memory.

I implemented the suggestions in the above article and it started working.

Example of other services that I got to work, no problem:

use SOAP::Lite +trace =>
        [qw(transport debug)],
        on_action => sub {sprintf '%s/%s', @_};

my $response;
my $s = SOAP::Lite
     -> uri('/examples')
     -> on_action(sub { sprintf '"%s"', shift })
     -> proxy('')

print '\n\n State '.$s->getStateName(SOAP::Data->name(statenum => 
25))->result ;

$s = SOAP::Lite
     -> uri('urn:xmethods-CurrencyExchange')
     -> proxy('');

$response = $s->getRate(SOAP::Data->name(country1 => 'England'),
                      SOAP::Data->name(country2 => 'Japan'))
print 'Currency rate for England/Japan is ', $response;

Take care,


View raw message