SOAP:解组错误:意外元素(uri:" ",本地:"lastCallDate")。预期的元素是<{}gracePeriod>,<{}token>



我正在通过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>

但不幸的是,我收到了一个Unmarshalling错误(如下所示(。但令人惊讶的是,当我删除/注释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 &lt;{}gracePeriod>,&lt;{}token> </faultstring>
</soap:Fault>
</soap:Body>
</soap:Envelope>

请建议我该如何解决这个问题?

错误意味着请求只接受了body&gracePeriod作为参数,而不是lastCallDate。〔已解决〕

最新更新