我试图使用excel表中的数据创建xmlsoap请求。目前,我使用了mako模板,但它需要XML模板。如何创建命名空间如下的请求(这只是一个小示例,而不是完整的XML):
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:mes="http://www.orange.com/Webalc/Interfaces/ManageSupplierQuote/RequestForQuotation/v3/message">
<soapenv:Header/>
<soapenv:Body>
<mes:CalculateSupplierQuote>
<!--1 to 500 repetitions:-->
<SupplierQuote>
<local_circuittype>Existing circuit</local_circuittype>
<local_businessOpportunity>Access to Orange Business Services Network</local_businessOpportunity>
<local_accessType>Upgrade/downgrade of full path diversity</local_accessType>
<!--Optional:-->
<local_configurationSite>single</local_configurationSite>
通过使用lxml库,我可以取得一些进展,但是我被卡住了。下面是我创建的代码。在
^{pr2}$
您错误地构造了信封元素。 的构造函数etree.元素接收要创建的xml元素的(完全限定)名称(即标记),在您的示例中是信封。在
将第一行改为:
相关问题 更多 >
编程相关推荐