Dear List,
I'm trying to build a client to consume a SOAP webservice,
and am
having the damnedest time getting ZSI to pass along
namespace
information to its generated SOAP message. The code is
illustrated
below, along with the tracefile output for the SOAP request.
Please
note that the <process /> and <input /> tags are
unqualified, despite
being explicitly qualified in the generating code. The code
otherwise
works (I can cut and paste the below query, add the
namespaces by
hand, and send it to the webservice via curl and get the
right
response). So the question is: why won't it augment the
appropriate
tags with the declared namespaces? Any insight would be
appreciated,
as I've been toiling over this for what seems like forever
T_T...
def call_web_service(payload):
from ZSI.client import Binding
from ZSI import TC
import sys
url = 'https://www.example.com/
'
n = 'aeg:do-process'
b = Binding(url = url, ns = n, tracefile = sys.stdout,
nsdict={'ns': n})
class process:
def __init__(self, query):
self.input = payload
process.typecode=TC.Struct(process,[TC.String("ns:input
")], "ns:process")
return b.RPC(url, 'ns:process', process(query),
nsdict={'ns': n})
Produces:
_________________________________ Thu Nov 8 16:48:20 2007
REQUEST:
<SOAP-ENV:Envelope
xmlns:SOAP-ENC="http:
//schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http:
//schemas.xmlsoap.org/soap/envelope/"
xmlns:ZSI="http://www.z
olera.com/schemas/ZSI/"
xmlns:ns="aeg:do-process" xmlns sd=&q
uot;http://www.w3.
org/2001/XMLSchema"
xmlns si=&q
uot;http://www.w3.org/2001/XMLSch
ema-instance"><SOAP-ENV:Header></SOAP-ENV:H
eader><SOAP-ENV:Body><process><input
xsi:type="xsd:string">__PAYLOAD__</input>
</process></SOAP-ENV:Body></SOAP-ENV:Envelope
>
_________________________________ Thu Nov 8 16:48:21 2007
RESPONSE:
500
Internal Server Error
_______________________________________________
XML-SIG maillist - XML-SIG python.org
http:
//mail.python.org/mailman/listinfo/xml-sig
|