我试图从双字段api中请求已删除的事务。就我从文档获得的信息而言,我向邮递员提出了一个有效的请求,但是每次我得到返回代码500 ->内部服务器错误。我使用以下soap请求:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:twin="http://www.twinfield.com/">
<soapenv:Header>
<twin:Header>
<twin:AccessToken>{{Accescode}}</twin:AccessToken>
<twin:CompanyCode>{{Company}}</twin:CompanyCode>
</twin:Header>
</soapenv:Header>
<s:Body>
<Query i:type="a:GetDeletedTransactions" xmlns="http://www.twinfield.com/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:a="http://schemas.datacontract.org/2004/07/Twinfield.WebServices.DeletedTransactionsService">
<b:CompanyCode>{{Company}}</b:CompanyCode>
<b:Daybook>SomeDaybook</b:Daybook>
<b:DateFrom>2021-04-01</b:DateFrom>
<b:DateTo>2021-04-02</b:DateTo>
</Query>
</s:Body>
</s:Envelope>标题设置如下所示:头部设置
我试过了,因为公司代码是可选的,但这也给了我同样的结果。
关于如何从删除的交易中获得回报,有什么建议吗?
发布于 2022-06-27 07:38:58
最后,缺少的是de模式,正确的XML信封需要如下所示
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:Authentication xmlns:h="http://www.twinfield.com/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<AccessToken xmlns="http://schemas.datacontract.org/2004/07/Twinfield.WebServices.Shared">{{Accescode}}</AccessToken>
<CompanyCode xmlns="http://schemas.datacontract.org/2004/07/Twinfield.WebServices.Shared">{{Company}}</CompanyCode>
</h:Authentication>
</s:Header>
<s:Body>
<Query i:type="b:GetDeletedTransactions" xmlns="http://www.twinfield.com/" xmlns:a="http://schemas.datacontract.org/2004/07/Twinfield.WebServices" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:b="http://schemas.datacontract.org/2004/07/Twinfield.WebServices.DeletedTransactionsService">
<b:CompanyCode>{{Company}}</b:CompanyCode>
<b:DateFrom>2022-01-01T00:00:00</b:DateFrom>
<b:DateTo>2022-12-31T23:59:00</b:DateTo>
<b:Daybook></b:Daybook>
</Query>
</s:Body>
</s:Envelope>发布于 2022-06-24 13:07:29
datefrom和dateto值无效。这些不应包括日期分隔器(-)。这应该是可行的:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:twin="http://www.twinfield.com/">
<soapenv:Header>
<twin:Header>
<twin:AccessToken>{{Accescode}}</twin:AccessToken>
<twin:CompanyCode>{{Company}}</twin:CompanyCode>
</twin:Header>
</soapenv:Header>
<s:Body>
<Query i:type="a:GetDeletedTransactions" xmlns="http://www.twinfield.com/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:a="http://schemas.datacontract.org/2004/07/Twinfield.WebServices.DeletedTransactionsService">
<b:CompanyCode>{{Company}}</b:CompanyCode>
<b:Daybook>SomeDaybook</b:Daybook>
<b:DateFrom>20210401000000</b:DateFrom>
<b:DateTo>20210402235959</b:DateTo>
</Query>
</s:Body>
</s:Envelope>https://stackoverflow.com/questions/72213409
复制相似问题