【问题标题】:SOAP: Unmarshalling Error: unexpected element (uri:"", local:"lastCallDate"). Expected elements are &lt;{}gracePeriod>,&lt;{}token>SOAP:解组错误:意外元素(uri:“”,本地:“lastCallDate”)。预期元素是 <{}gracePeriod>、<{}token>
【发布时间】: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 &lt;{}gracePeriod>,&lt;{}token> </faultstring>
        </soap:Fault>
    </soap:Body>
</soap:Envelope>

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

【问题讨论】:

    标签: xml soap postman


    【解决方案1】:

    该错误意味着请求仅接受 body 和 gracePeriod 作为参数,而不是 lastCallDate。 [已解决]

    【讨论】:

      猜你喜欢
      • 2016-07-12
      • 2021-09-05
      • 2018-08-01
      • 1970-01-01
      • 2018-01-10
      • 1970-01-01
      • 2017-08-14
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多