微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

JIBX:在肥皂响应中忽略无序组中的未知元素

如何解决JIBX:在肥皂响应中忽略无序组中的未知元素

我想忽略我在来自soap api 的响应中收到的未知元素。所以我在元素的映射上的绑定文件添加了这些属性flexible = true和odred = false。

从绑定文件提取

<mapping abstract="true" type-name="ns1:MakeReservationResponseType" class="com.path.MakeReservationResponseType" ordered="false" flexible="true">
  <structure map-as="ns1:ControlType" get-method="getControl" set-method="setControl" name="Control"/>
  <structure get-method="getResponse" set-method="setResponse" usage="optional" name="Response" ordered="false" flexible="true">
    <structure map-as="ns1:ResponseBaseFields-Group" get-method="getResponseBaseFields" set-method="setResponseBaseFields" usage="optional"/>
    <structure map-as="ns1:BookingType" get-method="getBooking" set-method="setBooking" name="Booking"/>
    <structure map-as="ns1:PriceDataType" get-method="getPrice" set-method="setPrice" name="Price"/>
  </structure>
  <structure map-as="ns1:ErrorResponseType" get-method="getError" set-method="setError" usage="optional" name="Error"/>
</mapping>

当我尝试解组收到的响应时,出现此错误

"Expected "{apiUrl}Response" end tag,found "{
apiUrl}Item" start tag (line -1,col -1,in SOAP-message),role=supplier,property=Expected "{apiUrl}Response" end tag,in SOAP-message"

出现此错误是因为我收到了一个未在我的 xsd 和绑定文件中声明的未知对象。 但在本文档中说,如果我添加灵活 = true 和有序 = false,我可以忽略未知元素:http://jibx.sourceforge.net/tutorial/binding-extras.html#mixing 但是这个解决方案不起作用,我有上面的错误。 我使用这个版本的jibx:1.3.3 有人可以帮我吗? 谢谢

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。