I have a strange problem where I am working with a web application
provider, Desire2Learn, who has created a SOAP API that I can get working
using PHP's SoapClient library but I have been unable to get working with
suds. I have gone as far as making certain both the headers in the POST
and the SOAP envelope are identical in the suds test program as my PHP
test program, and still have no luck.
I think the problem has to do with a hack that D2L made to allow web
browsers to receive a web page when hitting the SOAP HTTP interfaces. If
you put a D2L SOAP URL in Firefox you get back a nicely rendered help page
complete with CCS. I think D2L may be doing this by checking to see if
there is a SOAP envelope in the packet they receive and if not return a
HTML page instead of a SOAP response. The final difference I see between
the Python suds network traffic and the PHP SoapClient traffic is that
suds sends the SOAP request in two packets (one for header and one for
SOAP envelope) while PHP does so in one. I think the SOAP envelope being
absent from the POST header packet may be what is causing D2L to return
the HTML help page response instead of the result SOAP packet.
The actual two packet send is not occurring in the suds module. It is in
httplib.HTTPConnection._send_request. That is the method that I would
like to replace. However I cannot see a way of replacing it without
replacing everything from suds.transport.Transport.u2open on up the call
stack. I could of course create a custom httplib library that is hacked
for my purposes, but I think there should be a cleaner solution.
Anyone have any suggestions? Has anyone hacked suds to communicate in
single packets?
Any advice would be welcome. Thanks.