我有以下PHP示例代码:
$client = new SoapClient("http://example.com/example.wsdl");
$h = Array();
array_push($h, new SoapHeader("http://example2.com/example2/", "h", "v"));
$client->__setSoapHeaders($h);
$s = $client->__soapCall('Op', $data);我的问题是: SOAPpy对于SoapHeader()和__setSoapHeaders()部分的等效性是什么?
相关问题
发布于 2009-12-07 00:52:40
下面是一个使用苏打库(SOAPpy的另一种选择)的示例。它假定wsdl中没有定义自定义标头。
from suds.client import Client
from suds.sax.element import Element
client = Client("http://example.com/example.wsdl")
# <tns:h xmlns:tns="http://example2.com/example2/">v</tns:h>
tns = ("tns", "http://example2.com/example2/")
h = Element('h', ns=tns).setText('v')
client.set_options(soapheaders=h)
#
s = client.service.Op(data)https://stackoverflow.com/questions/1856963
复制相似问题