Python中的Soap调用
|
我试图打电话给肥皂服务。我的呼叫是成功的,但返回空值。下面我附加了我的soap请求和响应模式。它以1d数组作为输入并返回该数组。
请求架构
<?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>
<CalculateWeb1D xmlns=\"http://tempuri.org/\">
<HCID>string</HCID>
<jaggedobjDataMICRO>
<string>string</string>
<string>string</string>
</jaggedobjDataMICRO>
<numeratorID>int</numeratorID>
</CalculateWeb1D>
</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>
<CalculateWeb1DResponse xmlns=\"http://tempuri.org/\">
<CalculateWeb1DResult>
<string>string</string>
<string>string</string>
</CalculateWeb1DResult>
</CalculateWeb1DResponse>
</soap:Body>
</soap:Envelope>
我给肥皂服务打电话的代码
from SOAPpy import WSDL
import warnings
warnings.simplefilter(\'ignore\',DeprecationWarning)
import SOAPpy
wsdlFile = \'http://204.9.76.243/nuCast.DataFeedService/Service1.asmx?WSDL\'
server = WSDL.Proxy(wsdlFile)
server.soapproxy.config.dumpSOAPOut = 1
server.soapproxy.config.dumpSOAPIn = 1
print server.CalculateWeb1D(str(1073757),[1,2],99)
和我的输出
*** Outgoing SOAP ******************************************************
<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<SOAP-ENV:Envelope
SOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\"
xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\"
xmlns:xsi=\"http://www.w3.org/1999/XMLSchema-instance\"
xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\"
xmlns:xsd=\"http://www.w3.org/1999/XMLSchema\"
>
<SOAP-ENV:Body>
<CalculateWeb1D SOAP-ENC:root=\"1\">
<v1 xsi:type=\"xsd:string\">1073757</v1>
<v2 SOAP-ENC:arrayType=\"xsd:int[2]\" xsi:type=\"SOAP-ENC:Array\">
<item>1</item>
<item>2</item>
</v2>
<v3 xsi:type=\"xsd:int\">99</v3>
</CalculateWeb1D>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
************************************************************************
*** Incoming SOAP ******************************************************
<?xml version=\"1.0\" encoding=\"utf-8\"?><soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><soap:Body><CalculateWeb1DResponse xmlns=\"http://tempuri.org/\" /></soap:Body></soap:Envelope>
************************************************************************
<SOAPpy.Types.structType CalculateWeb1DResponse at 171814380>: {}
请帮助我找到解决方案....
没有找到相关结果
已邀请:
1 个回复
孝箱捆讨
客户端的工作版本:
请求
响应