我从这样一个XML开始:
myXML="""<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:mes="http://www.ercot.com/schema/2007-06/nodal/ews/message">
<soapenv:Header> </soapenv:Header>
<soapenv:Body>
<RequestMessage xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.ercot.com/schema/2007-06/nodal/ews/message">
<Header>
<Verb>get</Verb>
<Noun>BidSet</Noun>
<ReplayDetection>
<Nonce>177766768</Nonce>
<Created>2018-10-22T09:03:33.169-05:00</Created>
</ReplayDetection>
<Revision>1</Revision>
<Source>QSAMP</Source>
<UserID>USER1</UserID>
<MessageID>test</MessageID>
<Comment>test</Comment>
</Header>
<Request>
<ID>QSAMP.20181020.EB.AB_C.BID123</ID>
</Request>
</RequestMessage>
</soapenv:Body>
</soapenv:Envelope>"""
我需要签个字,这样看起来像这样
^{pr2}$另外,这里的证书信息不是真实的,所以不用担心。在
我查看了文档中的示例页面,但不知道它们的源xml是什么样子的,因此对我的用例进行建模非常困难。在
它在
zeep
,xmlsec
的源代码上做了一些摸索,甚至尝试了lxml
构造函数,但这里是:unsigned-soapenv.xml
是你的信封。在如果需要示例签名和证书,它们来自^{}'s test data 。在
无价的是
ipdb
,它是一个具有自动完成功能的调试器。在你的终端里,像这样试试:import ipdb; ipdb.set_trace()
python-zeep包对WSSE-check out the documentation具有初步支持。在
相关问题 更多 >
编程相关推荐