收到 xs:timestamp 而不是 xs:date,当客户端应用调用我们的 JAX-WS API 时。

huangapple 未分类评论43阅读模式
英文:

Getting xs:timestamp instead of xs:date when client application calls our jax-ws api

问题

我们的SOAP API中有日期限制,使用xs:date,模式为'\d{4}-\d{2}-\d{2}'。我们可以使用SOAP UI进行测试,运行正常。当客户端应用调用我们的API时,由于日期字段值是时间戳,导致我们的架构验证抛出错误并生成SOAP Fault。

我们使用JAX-WS规范的API来实现我们的Web服务(应用服务器为Websphere),并使用WAS默认实现。

在客户端SOAP日志中,日期值打印为'1990-01-01',但在我们的应用程序SOAP日志中,它被打印为'1990-01-01T06:00:00.000Z'。(客户端使用Metro JAX-WS实现)。
我在这里漏掉了什么?

英文:

We have date restriction in our SOAP API as xs:date with pattern as '\d{4}-\d{2}-\d{2}'. We are able to test it using SOAP UI and it runs fine. When client application calls our API, we are getting date field value as timestamp due to which our schema validation throws an error and generate SOAP Fault.

We are using JAX-WS specification API to implement our web services (Websphere as an application server) and using WAS default implementation.

In client SOAP logs, date value getting printed as '1990-01-01' but in our application SOAP logs it is getting printed as '1990-01-01T06:00:00.000Z'. (Client using Metro JAX-WS implementation).
What am I missing here?

答案1

得分: 0

这是由于 WebSphere(版本 8.5.5,修补程序包 16)在移交给 SOAP 处理程序之前处理/转换 SOAP XML 导致的。为了禁用此功能,并在处理程序中保持原样的 SOAP XML,我们将 WAS 属性 jaxws.payload.highFidelity 设置为 true。在此之后,我们获得了正确的 SOAP XML,我们的 XML 模式验证正常工作。

英文:

This was happening due to WebSphere (version 8.5.5, fix pack 16) processing/transforming SOAP XML before handing over to SOAP Handlers. To disable this and having as it is SOAP XML in handlers, we set WAS property jaxws.payload.highFidelity as true. After this we are getting correct SOAP XML and our XML schema validation works as expected.

huangapple
  • 本文由 发表于 2020年4月10日 17:26:48
  • 转载请务必保留本文链接:https://java.coder-hub.com/61137432.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定