Hi. If I am trying to call a .NET web service but this results in the error / suds.WebFault: Server raised fault: 'Server was unable to process request. ---> Object reference not set to an instance of an object.' / I do not have access to the .NET server code , but I 've got a sample request.xml file and the difference i notice with what suds sends is at namespaces that suds creates .
The sample request looks like this:
<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/%22%3E soap:Body <ProcessTransaction xmlns="http://piraeusbank.gr/paycenter"> <TransactionRequest xmlns="http://piraeusbank.gr/paycenter/1.0"> <Header> <RequestType>SALE</RequestType>
What I have done so far and sent through suds (got it with client.last_sent() ) is like this:
<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:ns0="http://piraeusbank.gr/paycenter/1.0" xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="http://piraeusbank.gr/paycenter" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/%22%3E SOAP-ENV:Header/ ns1:Body ns2:ProcessTransaction ns2:TransactionRequest ns2:TransactionRequest ns0:Header ns0:RequestTypeSALE</ns0:RequestType>
as you see suds adds some namespaces at the top and uses each before a node name like this : ns1:Body , ns2:TransactionRequest and so on.
So I am asking: 1. Can I stop suds creating namespaces before each node name. 2. Can I debug more what is going on or there is no use since I cannot have access to the server code. 3. Suds also adds a self closing SOAP-ENV:Header/ .
Web services were supposed to be created for interoperability , but i don't know how is this supposed to be done since most of the times you trying to communicate you get a generic error from the remote server..
Thanks all .