尝试 POST 到 Cyber​​source 简单订单 API 时没有收到 WS-Security Header 错误

Receiving No WS-Security Header error when attempting to POST to Cybersource Simple Order API

我正在尝试 POST 使用 Postman 发送 Cyber​​source 简单订单 API,但这样做时没有 header 错误。我在这里做错了什么?既然是商户ID作为用户名,那么密码是什么,这应该是Simple Order交易处理key吧?

将以下 XML 数据发布到测试端点 (https://ics2wstesta.ic3.com/commerce/1.x/transactionProcessor):

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext1.0.xsd">
<wsse:UsernameToken>
         <wsse:Username>merchantname</wsse:Username>
         <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile1.0#PasswordText">key</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
<requestMessage xmlns="urn:schemas-cybersource-com:transaction-data-1.150">
<merchantID>merchantname</merchantID>
<merchantReferenceCode>12345678912</merchantReferenceCode>
<recurringSubscriptionInfo>
<subscriptionID>12345678901234567890</subscriptionID>
</recurringSubscriptionInfo>
<paySubscriptionDeleteService run="true"/>
</requestMessage>
</soapenv:Body>
</soapenv:Envelope>

您的命名空间有一个小错误。你错过了一个“-”。

oasis-200401-wss-wssecurity-secext1.0.xsd

应该是

oasis-200401-wss-wssecurity-secext-1.0.xsd

oasis-200401-wss-username-token-profile1.0#PasswordText

应该是

oasis-200401-wss-username-token-profile-1.0#PasswordText