嗨,上面是我之前关于肥皂的问题。在那里我传递一个一维数组。现在我的问题是我需要将二维数组传递给以下 Soap 模式。
请求架构
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<CalculateWeb2DObjectArray xmlns="http://tempuri.org/">
<HCID>string</HCID>
<jaggedobjDataMICRO>
<ArrayOfAnyType>
<anyType />
<anyType />
</ArrayOfAnyType>
<ArrayOfAnyType>
<anyType />
<anyType />
</ArrayOfAnyType>
</jaggedobjDataMICRO>
<numeratorID>int</numeratorID>
</CalculateWeb2DObjectArray>
</soap:Body>
</soap:Envelope>
响应模式
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<CalculateWeb2DObjectArrayResponse xmlns="http://tempuri.org/">
<CalculateWeb2DObjectArrayResult>
<ArrayOfAnyType>
<anyType />
<anyType />
</ArrayOfAnyType>
<ArrayOfAnyType>
<anyType />
<anyType />
</ArrayOfAnyType>
</CalculateWeb2DObjectArrayResult>
</CalculateWeb2DObjectArrayResponse>
</soap:Body>
</soap:Envelope>
我的代码
from suds.xsd.doctor import Import, ImportDoctor
from suds.client import Client
# enable logging to see transmitted XML
import logging
logging.basicConfig(level=logging.INFO)
logging.getLogger('suds.client').setLevel(logging.DEBUG)
# fix broken wsdl
# add <s:import namespace="http://www.w3.org/2001/XMLSchema"/> to the wsdl
imp = Import('http://www.w3.org/2001/XMLSchema',
location='http://www.w3.org/2001/XMLSchema.xsd')
imp.filter.add('http://tempuri.org/')
wsdl_url = 'http://204.9.76.243/nuCast.DataFeedService/Service1.asmx?WSDL'
client = Client(wsdl_url, doctor=ImportDoctor(imp))
# make request
arrayofstring1 = client.factory.create('ArrayOfString')
arrayofstring1.string = [1,2]
arrayofstring2 = client.factory.create('ArrayOfString')
arrayofstring2.string = [5,6]
arrayofstring = client.factory.create('ArrayOfString')
arrayofstring.string = [arrayofstring1,arrayofstring2]
print client.service.CalculateWeb2DObjectArray(1073757, arrayofstring, 99)
但是我在输出中得到了空值。请帮助解决这个问题。
谢谢