Menu

#10 No way to specify authentication methods

open
nobody
zsi (8)
5
2006-03-21
2006-03-01
No

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?

Discussion

  • Jason Toffaletti

    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.

     
  • Jason Toffaletti

    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

     
  • Mark Mitchell

    Mark Mitchell - 2006-03-07

    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.)

     
  • Joshua Boverhof

    Joshua Boverhof - 2006-03-21
    • labels: 372282 --> zsi
    • milestone: 562021 -->
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.