Web服务响应中的日期为空

时间:2013-12-17 12:06:27

标签: soap wsdl jax-ws

我正在尝试实现一个客户端,该客户端向JAX Web Service请求某些数据。我使用wsimport命令(安装了Java 7u45)从wsdl生成客户端类。我没有问题回到字符串类型但日期类型在Java代码中变为null。这就是我作为肥皂回应得到的回复:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:SearchControllerwsdl"><SOAP-ENV:Body><ns1:TorzsHorizontFelirAzonKeresE1Response><TorzsHorizontFelirAzonKeresE1Result><item><keresId>433</keresId><nev>Test Name</nev><szuletesiIdo>1948.09.05</szuletesiIdo><felirAzon>000000011</felirAzon><adoSzam>11111111</adoSzam><hibaKod>0</hibaKod><hibaSzoveg/></item></TorzsHorizontFelirAzonKeresE1Result></ns1:TorzsHorizontFelirAzonKeresE1Response></SOAP-ENV:Body></SOAP-ENV:Envelope>

szuletesiIdo在wsdl:

中定义
<xsd:element name="szuletesiIdo" type="xsd:date"/>

,其他元素是字符串类型。在Java代码中,获取字符串值没有问题,但响应中的XmlGregorianCalendar szuletesiIdo字段始终为null。请帮帮我。

1 个答案:

答案 0 :(得分:0)

xsd:date格式应为ISO日期格式为“2013-12-18T23:15:10”,但响应中的日期格式不正确“1948.09.05”,请与服务提供商核实更正他身边的日期格式。