Unless I'm misreading, you've almost got it. In the chunk below, you just
forgot to add the servicePwd element to the ReqSOAPHeader element.
On Fri, Dec 2, 2011 at 1:22 AM, 贾晓磊 <jiaxiaolei19871112(a)gmail.com> wrote:
from suds.sax.element import Element
from suds.sax.attribute import Attribute
code = Element('serviceCode').setText('PABB4BEIJING')
pwd = Element('servicePwd').setText('QWERTPABB')
reqsoapheader = Element('ReqSOAPHeader').insert(code)
reqsoapheader.insert(pwd)
reqsoap_attribute = Attribute('xmlns',
"http://schemas.acme.eu/")
reqsoapheader.append(reqsoap_attribute)
client.set_options(soapheaders=reqsoapheader)
It's probably a little cleaner to do it like this, though:
code = Element('serviceCode').setText('PABB4BEIJING')
pwd = Element('servicePwd').setText('QWERTPABB')
reqsoapheader = Element('ReqSOAPHeader')
reqsoapheader.children = [code, pwd]
--
david bonner // dbonner(a)cogolabs.com