PayPal's API requires that the user insert additional
entries into the SOAP envelope header. However,
client.Binding.Send does not provide any way to insert
additional stuff to put in the envelope header. I
considered subclassing SoapWriter, but there is also no
way to specify a different SoapWriter class to the
Binding object.
Perhaps Send could take an additional header_args
keyword arguments which would contain a list of
object/typecode pairs to be embedded in the envelope
header?
Logged In: YES
user_id=7148
What about some way of specifying a callback function which
gets called in Binding.Send with the SoapWriter. That seems
generic enough to me to support adding any type of auth to
the header. We'd then to something like:
def add_auth(binding, sw):
pyobj = ns0.RequesterCredentials_Dec().pyclass()
pyobj.Credentials = pyobj.new_Credentials()
pyobj.Credentials.Username = ''
pyobj.Credentials.Password = ''
pyobj.Credentials.Subject = ''
sw.serialize_header(pyobj, pyobj.typecode)
locator.getPayPalAPIAAInterface(add_auth_cb=add_auth)
I've been using ZSI and SOAP for only 1 day, so I'm sure
there is a better way, but hopefully this gets the point across.
Logged In: YES
user_id=7148
Here is a small patch that allows me to use PayPal's API.
http://subterrific.net/~jason/client.diff
Logged In: YES
user_id=1464377
Yes, that patch looks like just the right thing.
(By the way, I've got PayPal wired up to BizarShop now,
using ZSI.)