【发布时间】:2022-01-08 10:15:47
【问题描述】:
我正在通过 POSTMAN(XML 格式)发送 SOAP 请求,但出现上述错误。我打算在 SOAP 请求的正文中发送令牌以及 lastCallDate 参数。
我的要求:
<soapenv:Envelope
xmlns:plat="http://ws.digitalpaytech.com/plateInfo"
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-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-8230F690FFEA8F015916382936150461">
<wsse:Username>username@here</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">password@here</wsse:Password>
<wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">rZrJA+y3RZ1yNvK9oun31A==</wsse:Nonce>
<wsu:Created>2021-12-01T22:28:21Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
<plat:PlateInfoRequest>
<token>token@here</token>
<lastCallDate>2021-11-30T22:28:21Z</lastCallDate>
</plat:PlateInfoRequest>
</soapenv:Body>
</soapenv:Envelope>
但不幸的是,我收到了一个解组错误(如下所示)。但令人惊讶的是,当我删除/评论 lastCallDate 行时,我没有收到任何错误并成功获得响应。
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<soap:Fault>
<faultcode>soap:Client</faultcode>
<faultstring>Unmarshalling Error: unexpected element (uri:"", local:"lastCallDate"). Expected elements are <{}gracePeriod>,<{}token> </faultstring>
</soap:Fault>
</soap:Body>
</soap:Envelope>
请建议我应该如何解决这个问题?
【问题讨论】: