Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » Webservice date conversion problem
Webservice date conversion problem [message #902946] Tue, 21 August 2012 11:28 Go to next message
Bertin Kiekebosch is currently offline Bertin KiekeboschFriend
Messages: 330
Registered: August 2011
Senior Member
Hi,

I am converting an Java Swing application to a Scout application. I created a Webservice Consumer. When I call this webservice I get the following order:
 javax.xml.ws.soap.SOAPFaultException: Server was unable to read request. ---> There is an error in XML document (1, 311). ---> String was not recognized as a valid DateTime.]]


I can still call the webService with my old Java application from the same computer. So I assume that the Scout webservice implementation or JAX have an other way to convert dates that do not match with the server side.

How can I configure or fix this?

Regards Bertin
Re: Webservice date conversion problem [message #902948 is a reply to message #902946] Tue, 21 August 2012 11:33 Go to previous messageGo to next message
Arthur vD is currently offline Arthur vDFriend
Messages: 52
Registered: March 2010
Member
Hi Bertin

Your assumption seems very plausible. Can you post the relevant part of the soap message (interceptable with SoapUI, tcpMon, wireshark or similar)?

Regards

Arthur

[Updated on: Tue, 21 August 2012 13:59]

Report message to a moderator

Re: Webservice date conversion problem [message #902974 is a reply to message #902948] Tue, 21 August 2012 13:29 Go to previous messageGo to next message
Bertin Kiekebosch is currently offline Bertin KiekeboschFriend
Messages: 330
Registered: August 2011
Senior Member
Hi Arthur

I used the logHandler to get the soap message. I hope thats good enough.

[code]
SOAP request
WS_LOG_NR = 0
request = <?xml version="1.0" encoding="UTF-8"?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ControleerInput xmlns="http://www.xxxx.xx/xxx/xxx/xx/xx">
<Verzekerden>
<Verzekerde>
<Volgnummer>0</Volgnummer>
<BSN>101688246</BSN>
<GeboorteDatum>1959-09-02T23:00:00.000Z</GeboorteDatum>
<PeildatumVerzekering>2012-08-21T13:18:47.748Z</PeildatumVerzekering>
<SoortVerzekering>92</SoortVerzekering>
<NAWVerzekerdeRetourneren>true</NAWVerzekerdeRetourneren>
</Verzekerde>
</Verzekerden>
</ControleerInput>
</S:Body>
</S:Envelope>
[code]

the fields <GeboorteDatum> en <PeildatumVerzekering> are Dates


regards Bertin
Re: Webservice date conversion problem [message #902979 is a reply to message #902974] Tue, 21 August 2012 13:55 Go to previous messageGo to next message
Arthur vD is currently offline Arthur vDFriend
Messages: 52
Registered: March 2010
Member
They look like valid XML Schema DateTimes (not Dates) to me, so I'm a bit at a loss. I assume both are defined as DateTime elements in the schema.

"There is an error in XML document (1, 311)" would point exactly between the two dates in the SOAP message, so I'm not sure whether it refers to the first or the second DateTime.

Is that the SOAP message you send with Scout to some other server and the server answers with a SOAP message with the error indicated in your first post? I would try playing a bit with the message you send (using SoapUi or TcpMon) to see what difference it makes, or compare it with what your old Java application sends.

Good luck.
Re: Webservice date conversion problem [message #903024 is a reply to message #902979] Tue, 21 August 2012 16:37 Go to previous messageGo to next message
Bertin Kiekebosch is currently offline Bertin KiekeboschFriend
Messages: 330
Registered: August 2011
Senior Member
Hi,

the fields are both defined as type="xsd:date".

What i think is also strange is that I both entered them like a date without time, but they are both converted with a date with a different time

<GeboorteDatum>1959-09-03T11:00:00.000Z</GeboorteDatum>
<PeildatumVerzekering>2012-08-21T10:00:00.000Z</PeildatumVerzekering>

Regards bertin

Re: Webservice date conversion problem [message #903026 is a reply to message #903024] Tue, 21 August 2012 17:02 Go to previous messageGo to next message
Arthur vD is currently offline Arthur vDFriend
Messages: 52
Registered: March 2010
Member
Strange. And your old Java program sends Dates instead of DateTimes? What I don't understand is that the error message says that it is an invalid DateTime. I would expect it to say that it's an illegal Date..
Re: Webservice date conversion problem [message #903128 is a reply to message #903026] Wed, 22 August 2012 07:24 Go to previous messageGo to next message
Bertin Kiekebosch is currently offline Bertin KiekeboschFriend
Messages: 330
Registered: August 2011
Senior Member
Hi,

The server side expects the date in the format jjjj-MM-dd. So no time and timezone info. I noticed that in the Scout Object Properties view of my webservice there is a binding file that binds the xml dataType to a adapter class.

All bindings are made to the UtcDateAdapter class.

I created a custom adapter and changed the binding for xmlType="xsd:date" to my own class.

Now it works.

regards Bertin
Re: Webservice date conversion problem [message #903147 is a reply to message #903128] Wed, 22 August 2012 08:28 Go to previous message
Arthur vD is currently offline Arthur vDFriend
Messages: 52
Registered: March 2010
Member
Great. I still don't really understand the error message then, but when it works...
Previous Topic:Rayo look and feel problem
Next Topic:Multiple tabbed application
Goto Forum:
  


Current Time: Fri Mar 29 07:35:03 GMT 2024

Powered by FUDForum. Page generated in 0.23570 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top