Hi again, took a while..
So I captured some stuffs. Turns out suds is sending the following:
<?xml
version="1.0"
encoding="UTF-8"
?>
<SOAP-ENV:Envelope
<SOAP-ENV:Header/>
<ns2:Body>
<ns1:Initialize>
<ns1:Initialize>
<user xsi:type="xsd:string">SOAP</user>
<appl xsi:type="xsd:string">Python SOAP Wrapper</appl>
<v xsi:type="xsd:boolean">true</v>
<v501 xsi:type="xsd:boolean">true</v501>
<v700 xsi:type="xsd:boolean">true</v700>
<v800 xsi:type="xsd:boolean">true</v800>
</ns1:Initialize>
</ns2:Body>
</SOAP-ENV:Envelope>
When I try to use the Initialize method of the WSDL file.
So what should be happening is that it uses SOAP-ENV:Body, but it's using
ns2:Body instead, which is making the server not recognise the commands.
I also don't understand why I have ns0 through ns3, is this something to do
with the importdoctor?
-Remy
On 30 November 2011 17:09, Veres-Szentkiralyi Andras <vsza(a)vsza.hu> wrote:
Hi,
it'd help us to understand the issue, if you'd capture the network traffic
with a tool like Wireshark or tcpdump, and post it to the mailing list with
any sensitive information (including the base64-encoded credentials in the
Authorization HTTP header) removed.
Regards,
András Veres-Szentkirályi
2011. november 30. szerda 15:40:44 dátummal Remy de Boer ezt írta:
> Hi,
>
> I'm trying to connect to the SOAP interface of an innovaphone system.
> I'm using the following code to connect to the WSDL file:
>
> from suds.client import Client
>
> > from suds.xsd.doctor import ImportDoctor, Import
> > from suds.transport.http import HttpAuthenticated
> >
> > imp =
Import('http://schemas.xmlsoap.org/soap/encoding/')
> >
imp.filter.add('http://innovaphone.com/pbx')
> >
imp.filter.add('http://innovaphone.com/binding')
> >
> > d = ImportDoctor(imp)
> > url = 'http://localhost/pbx800.wsdl'
> > t = HttpAuthenticated(username='****', password='****')
> >
> > client = Client(url, transport=t, doctor=d)
> >
> > print client
> > print client.service.Version()
>
> The WSDL file I'm using is the same as at:
>
http://www.innovaphone.com/wsdl/pbx800.wsdl
>
> With the 5th to last line (soap:address location) edited to point to our
> PBX server.
>
> running the above script results in the following error:
>
> File "sudstest.py", line 16, in <module>
>
> > print client.service.Version()
> >
> > File
> >
> >
"/usr/lib/python2.6/site-packages/suds-0.4-py2.6.egg/suds/client.py",
> > line 542, in __call__
> >
> > return client.invoke(args, kwargs)
> >
> > File
> >
> >
"/usr/lib/python2.6/site-packages/suds-0.4-py2.6.egg/suds/client.py",
> > line 602, in invoke
> >
> > result = self.send(soapenv)
> >
> > File
> >
> >
"/usr/lib/python2.6/site-packages/suds-0.4-py2.6.egg/suds/client.py",
> > line 643, in send
> >
> > result = self.succeeded(binding, reply.message)
> >
> > File
> >
> >
"/usr/lib/python2.6/site-packages/suds-0.4-py2.6.egg/suds/client.py",
> > line 678, in succeeded
> >
> > reply, result = binding.get_reply(self.method, reply)
> >
> > File
> >
> >
"/usr/lib/python2.6/site-packages/suds-0.4-py2.6.egg/suds/bindings/bindin
> > g.py", line 149, in get_reply
> >
> > soapenv.promotePrefixes()
> >
> > AttributeError: 'NoneType' object has no attribute
'promotePrefixes'
>
> When I quote out the "print client.service.Version()" line, it displays
all
> the methods from the WSDL file, but when I leave it uncommented, the
"print
> client" line doesn't get printed before the error comes up.
>
> Any idea what's causing this error?
>
> I'm using python version 2.6.6 and suds version 0.4
>
> Thanks in advance!
>
> -Remy