我在让SUDS很好地使用netsuitesoapi时遇到了一些困难。我已经尝试过SoapUI来发送netsuitexml,它适用于我想要的调用,但是我无法让它与Python一起工作。以下是工作的XML:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:urn="urn:messages_2015_1.platform.webservices.netsuite.com"
xmlns:urn1="urn:core_2015_1.platform.webservices.netsuite.com"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>
<soapenv:Header>
<urn:preferences>
</urn:preferences>
<urn:partnerInfo>
</urn:partnerInfo>
<urn:applicationInfo>
</urn:applicationInfo>
<urn:passport>
<urn1:email>*****</urn1:email>
<urn1:password>*****</urn1:password>
<urn1:account>*****</urn1:account>
<!--Optional:-->
<urn1:role internalId=*****>
</urn1:role>
</urn:passport>
</soapenv:Header>
<soapenv:Body>
<urn:get>
<urn1:baseRef internalId="2026" type="customer" xsi:type="urn1:RecordRef"/>
</urn:get>
</soapenv:Body>
</soapenv:Envelope>
在Python中,我生成了一个RecordRef对象并填充了它,但它不关心我的输入:
^{pr2}$当我看一看正在发送的XML时,我注意到xsi:类型是正在设置,但类型未设置。在
如果我设置客户(真的xsi:客户)对于在SoapUI中工作的相同值,我得到一个关于未设置customer的错误:
(ReadResponse){
status =
(Status){
_isSuccess = False
statusDetail[] =
(StatusDetail){
_type = "ERROR"
code = "RCRD_TYPE_REQD"
message = "The record type is required."
},
}
}
>>> recordRef
(RecordRef){
name = None
_internalId = 2026
_externalId = ""
_type = "ns1:RecordRef"
}
我已经有五年没有做过任何关于SOAP的事情了,以前也从来没有用过Python。如有任何建议,我们将不胜感激。在
弄明白了,我需要编写一个插件来调用marshaled()方法:
相关问题 更多 >
编程相关推荐