我正在尝试消费 TxServer web service ,但我收到错误响应
Unmarshalling Error: unexpected element (uri: "http://txserver.sut.softekpr.com/1", local:"transaction")
. Expected elements are
<{}transaction>`.
我发现 Delphi 生成的 XML 不适用于该服务,
但如果我添加 xmlns=""
到交易标签,它起作用了。
谁能帮我添加xmlns=""
到交易标签?
我想要:<transaction xmlns="">
。
顺便说一句,我尝试更改:InvRegistry.RegisterInvokeOptions(TypeInfo(TxServer), ioDocument);
到所有 io.. 选项,但它不起作用。
<?xml version="1.0"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<requestIVULoto xmlns="http://txserver.sut.softekpr.com/1">
<transaction>
<merchantId>00000000000</merchantId>
<municipalTax>.01</municipalTax>
<stateTax>.06</stateTax>
<subTotal>1</subTotal>
<tenderType>CASH</tenderType>
<terminalId>POS02</terminalId>
<terminalPassword/>
<total>1.07</total>
<txDate>2011-05-05T10:02:17.708Z</txDate>
<txType>SALE</txType>
</transaction>
</requestIVULoto>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
最佳答案
RemClassRegistry.RegisterXSClass(InstitutionCode, #0, 'InstitutionCode');
其中 InstitutionCode
是某个节点名称,#0
空字符,只是空字符串 '' 不起作用,它会被生成的名称替换。
宽字符串可能会出现问题,但您可以使用 TXSString 代替
关于web-services - 使用 Transaction Exchange Server Web 服务时如何获得正确的命名空间?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5899127/