Using Python to talk to a Perl SOAP::Lite server

Curtis Poe cp at onsitetech.com
Wed Jul 17 18:51:02 EDT 2002


Hi all,

My apologies if this is viewed as off-topic.

I have a SOAP server written in Perl using SOAP::Lite.  I have no problem
using this to instantiate an object using Perl and then making method calls
on it.  However, the client software is being written in Python and my
coworker (who, like me, is unfamiliar with SOAP), cannot seem to perform the
same task.  If I recode the SOAP server to use functions instead of methods,
he has no problem connecting and getting appropriate responses.  Here's the
Python code:

######################

from ZSI.client import Binding

server = Binding(url='/soap/temper.cgi',
                 ns='http://192.168.1.26/Temperatures',
                 host='192.168.1.26',
                 port=80,
                 soapaction='')
try:
    print server.f_f2c(100) # Works
    print server.new()      # Doesn't
except:
    print "Got XML I can't parse:"
    print server.ReceiveRaw()

######################

Note that the line marked "Works" is a simple function call and is not
dependant on an object.

And here's the XML that it prints:

######################

<SOAP-ENV:Body>
  <namesp1:newResponse xmlns:namesp1="http://192.168.1.26/Temperatures">
    <Temperatures xsi:type="namesp1:Temperatures">
      <_format xsi:type="xsd:string">%.2f</_format>
    </Temperatures>
  </namesp1:newResponse>
</SOAP-ENV:Body>

######################

I've been searching through mailing lists, Google, and FAQS for about three
hours and I am not even close to getting an answer.  Is it possible that
Python cannot instantiate a Perl object via SOAP?  (I don't know anything
about SOAP, either, so this may be a stupid question).

--
Curtis "Ovid" Poe, Senior Programmer, ONSITE! Technology
Someone asked me how to count to 10 in Perl:
push @A, $_ for reverse q.e...q.n.;for(@A){$_=unpack(q|c|,$_);@a=split//;
shift @a;shift @a if $a[$[]eq$[;$_=join q||, at a};print $_,$/for reverse @A





More information about the Python-list mailing list