Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

xml datetime format "2009-12-25T07:00:00"

40 views
Skip to first unread message

Paul Murray

unread,
Nov 20, 2009, 9:33:02 AM11/20/09
to
Greetings All,

I have a webservice that I am consuming using PB 11.2. The webservice
expects that the datetime (timestamp) field will be formatted with a T
between the date and time.

"the timestamp value representation with the T in between
(2009-12-25T07:00:00) is defined by XML Schema:
http://www.w3.org/TR/xmlschema-2/#dateTime"

I have seen other posts suggesting that I simply send the formatted data as
a string.

Question: The data is formatted in the proxy and the structure as a datetime
field. Can I simply change this to a string and expect it to work?

Also, what is a good technique to view the XML that is generated to access
the web service so that I know the xml is correctly formatted?

Thank you!!

Paul


Paul Murray

unread,
Nov 21, 2009, 9:48:13 AM11/21/09
to
Greetings all,

When I try to change the datetime variables to string in the structure and
the proxy, the datatype flips back to datetime in the proxy during the
deploy.

I wouldn't care except that datetime never 'seems' to reach the server.

How can I know if the data is actually being sent?

Thank you!!

Paul

"Paul Murray" <pemu...@interrasys.com> wrote in message
news:4b06a89e@forums-1-dub...

Paul Murray

unread,
Nov 21, 2009, 6:22:01 PM11/21/09
to
Okay, I figured it out.

The web service was actually working, but some of the pricing values were
not be calculated correctly based on the date being a holiday.

I had my datatypes displayed on the Visual Rules Execution Server Console in
Tomcat and saw that each one defaulted to '1969-12-31 19:00:00.0' (certainly
not the values that I was using).

So (based on information gleaned from previous posts) I downloaded WireShark
which is a free IP Sniffer. I put in a filter to only log TCP traffic and
Voila, there it was. I could see complete XML SOAP envelope that was sent
and immediately realized that NONE of the datetime related data was being
sent, but the rest of the data was. There was not even empty tags for my
datetime fields.

Then I remembered seeing some data in the structures that had been created
that I had ignored because I did not understand what it was. For each
datetime field that existed in the proxy (and the structures) there was an
associated field with a Boolean data type. So for my two datetime fields
as:

- pickup_date_time_specified
- flight_departure_date_time

there was an additional field as:

- pickup_date_time_specifiedSpecified
- flight_departure_date_timeSpecified

Where did it come from? Who knows? I certainly cannot find it in the WSDL
that I am consuming.

So I had code to populate the two datetime fields as:

request.input.flight_departure_date_time = flight_departure_date_time
request.input.pickup_date_time_specified = pickup_date_time_specified

Which did not work.

So I changed the code as follows:

request.input.flight_departure_date_time = flight_departure_date_time
request.input.flight_departure_date_timespecified = true
request.input.pickup_date_time_specified = pickup_date_time_specified
request.input.pickup_date_time_specifiedspecified = true

And then it worked!! Why? I don't know. Can anyone comment?

I will mention that I changed the data type in the structure for the two
original datetime fields to string (as the data is supposed to go across
like '2009-12-25T07:00:00'. Maybe it has an effect, maybe not. I will have
to test.

Thanks for listening and thanks for any comments.

Paul

"Paul Murray" <pemu...@interrasys.com> wrote in message

news:4b07fdad@forums-1-dub...

0 new messages