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

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




0
Paul
11/20/2009 2:33:02 PM
sybase.powerbuilder.xml 546 articles. 0 followers. Follow

3 Replies
695 Views

Similar Articles

[PageSpeed] 12

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" <pemurray@interrasys.com> wrote in message 
news:4b06a89e@forums-1-dub...
> 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
>
>
>
> 


0
Paul
11/21/2009 2:48:13 PM
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" <pemurray@interrasys.com> wrote in message 
news:4b07fdad@forums-1-dub...
> 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" <pemurray@interrasys.com> wrote in message 
> news:4b06a89e@forums-1-dub...
>> 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
>>
>>
>>
>>
>
> 


0
Paul
11/21/2009 11:22:01 PM
Better late comments than no comments?

The ".specified" fields are "NOT NULL" indicators.
PB will set the indicators correctly based on whether you send NULL or not 
since the actual SOAP over HTTP call is actually an XML formatted text 
document posted to the web-server.

Example using pseudo-code for the XML text:
// - - - - Local declarations
any         la_OrderList
datetime    ldt_Now

// - - - - Call using a value
ldt_Now = DateTime( "2009-12-23 12:34:56.789" )
la_OrderList = lws_webservice_proxy.GetOrders( ldt_Now )
    // PB assigns as follows:
    //    OrderDateTime =  "2009-12-23T12:34:56.789"
    //    OrderDateTime_Specified = TRUE

// - - - - Call using NULL
SetNull( ldt_Now )
la_OrderList = lws_webservice_proxy.GetOrders( ldt_Now )
    // PB assigns as follows:
    //    OrderDateTime =  ""
    //    OrderDateTime_Specified = FALSE


HTH
/MicKr-


"Paul Murray" <pemurray@interrasys.com> wrote in message 
news:4b087619$1@forums-1-dub...
> 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" <pemurray@interrasys.com> wrote in message 
> news:4b07fdad@forums-1-dub...
>> 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" <pemurray@interrasys.com> wrote in message 
>> news:4b06a89e@forums-1-dub...
>>> 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
>>>
>>>
>>>
>>>
>>
>>
>
> 


0
Michael
5/6/2010 6:39:52 PM
Reply:

Similar Artilces:

DateTime.ToString("d") still displays time (12:00:00 AM)
I'm trying to format a datetime variable to display the shortdatestring in a dropdown list in asp.net 2.0 but it still displays the time.  I've tried .ToShortDateString, ToString("d"), ToString("MM/dd/yyyy"), but I always get 01/01/2006 12:00:00 AM.Public Overrides Property WeekDate() As System.DateTimeGetReturn MyBase.WeekDate.ToString("MM/dd/yy")End GetSet(ByVal value As System.DateTime)MyBase.WeekDate = valueEnd SetEnd PropertyAny suggestions?  once you've gortten your datetime converted to a string, you need to keep it as a string.you...

Datawindow columns with "Transparent" background color & format as "$#,##0.00;[RED]($#,##0.00)"...
Hi, We have several datawindows with currency columns having "Transparent" background color & currency format ("$#,##0.00;[RED]($#,##0.00)"). Due to this format, the negative amounts would be red in color (for eg. (1234.56) ). When we print this datawindow in some printers (like IBM 24PS printers), the columns with negative amounts wouldn't get printed. Please note that this is not happening in other printers. Please also note that if I change the background color of the columns to "White", the printing is fine. Anybody have similar experien...

Response.Cache.SetExpires(DateTime.Parse("1/1/2003 12:00:00 AM"));
I found this code in a legacy application I am working on.  It seems this is being called in the page load of nearly every page on the site.   I did some research and could not exactally figure out why this was done. Could someone give me some insite as to what this would do?ThanksJeff To prevent the browser from caching the page.Darrell Norton, MVPDarrell Norton's BlogPlease mark this post as answered if it helped you! do you have any thoughts on why someone would do this?ThanksJeff...

Setting a valid default DateTime value (It doesn' t accept "00/00/00")
Hi,I am sending a date interval to the DB so that the user can search orders by specifying such interval. Somebody knows how can I pass a valid default DateTime value to the DB in case the user has not specified a date?For example: Sub search_orders(Sender As Object, e As EventArgs) Dim fromDate As DateTime If fDate.checked = True Then  fromDate = f_date.Text Else  fromDate = "00/00/00" End If  Dim toDate As DateTime If tDate.checked = True Then  toDate = t_date.Text Else  toDate = "00/00/00"  End If  Response.Re...

what is the difference bettween string.Format("{0:#.##}", and string.Format("{0:0.00}"
they both seem to do the same thing, what is the difference functionality that # versus 0  ?    string.Format("{0:#.##}", mydecimal); string.Format("{0:0.00}", mydecimal); Look here: http://msdn2.microsoft.com/en-us/library/0c899ak8.aspx Hope it helps Hi, As far as I know, they both are different. 0.00 can remain the position all the time. For example, decimal is 0.1 and then it will return to you with 0.10 by 0.00 format. With #.##, it will cut the unnecessary position in the decimal. For example, decimal is 0.1 and then i...

convert BASDA format XML to "standard" XML
hiya, Many of my recent problems have been that I have found it difficult to get my head round using XSLT on BASDA format XML.I feel that it would be easier to convert the BASDA format to "standard" XML, then do my XSLT. --BASDA snippet <rows> <row> <FIELD NAME="PRODUCT-TYPE">CAR</FIELD> <FIELD NAME="PRODUCT-DATE">01/01/2004</FIELD> </row> </rows> --what I regard as "standard" XML...easier to work with. <rows> <row> <PRODUCT-TYPE>CAR</P...

lblOverhead.Text = Format(.Rows(k)("sc_op_ovr"), "#,##0.00")
    Hi All,    What format "#.##0.00", this will accept? Pls give me one example. Thanks and Reagards    Abdul M.G  Hi There, Have a look at this article: http://msconline.maconstate.edu/Tutorials/ASPNET2/ASPNET07/aspnet07-01.aspx Scroll down to Custom Format Strings Hope it helps!DC517Don't forget to click "Mark as Answer" on the post that helped you. This credits that member, earns you a point and marks your thread as Resolved....

Format numeric value to "##,###.00" format.
how can i format a numeric value to a format with "," for thousands.. and 2 decimal places...  I tried String.Format("{0:N2}", value)... and String.Format("{0:F2}", value) but its not right... either thousands "," is not showing.. or no decimal places.Alvin ShihSoftware DeveloperMCP MCTS MCPD String.Format("{0:#,###.##}", Number); or String.Format("{0:#,###.00}", Number); depending on ur need  Vikram www.vikramlakhotia.comPlease mark the answer if it helped you  You can use this  String.Format "###...

Cast from string "00/00/00" to type 'Date' is not valid
hi, I am trying to solve this proble, for over 2 days and still.. i couldnt solve it  i am getting this error: Run-time exception thrown : System.InvalidCastException - Cast from string "00/00/00" to type 'Date' is not valid. how do i put "00/00/00" or even a NULL value ??  DATEE is diffine as datetime type in the data basenewNode = xmlTos.CreateElement("DATEE") newNode.InnerText = ="00/00/00" 'If Not IsDate(newNode.InnerText) Then ' newNode.InnerText = DBNull.Value 'System.DBNull.Value.ToString 'End If If n...

How do I parse XML attribute value "2008-02-13T10:15:04.0000000-06:00"?
How do I parse an XML timestamp attribute value "2008-02-13T10:15:04.0000000-06:00" in SQL Anywhere 9.0.2? E.g.... <xxx yyy="2008-02-13T10:15:04.0000000-06:00"> Prior to this I was receiving *ordinary* timestamp values like "2008-01-31 12:34" and the following Xpath query worked OK... INSERT aaa SELECT * FROM OPENXML ( @xml, '/bbb/ccc/xxx' ) WITH ( other columns... ... yyy TIMESTAMP './@yyy' ); Breck -- Breck Carter http://sqlanywhere.blogspot.com/ RisingRoad SQL Anywhere and...

"Attempt to use an "XML" extension that has not been registered..."
Hello, I am using Reporting Service in server mode.I currently have a report in which in include a few subreports. All of them use the same datasource (sqlserver 2005 database connectionstring)I have to add another report which is based on XML data. To do so, I created a new shared datasource, designed my query, added the report parameters, tested the query... This works but when I try to deploy this report on the report server I am getting an error I do not understand:"Attemps to use an "XML" extension of data that has not been registered for this report server"I do...

XML datetime in format '2001-12-17T09:30:47-05:00'
Hi there, i must create some xml with datetimes in it. It has to be of the format '2001-12-17T09:30:47-05:00'. I don't find how to do this. I've made expressions on my datetime but it has no effect on the result in XML. How do i even get the timezone information in it? Am i missing something or do i need to convert the datetimes to string and make the string manually? Many thanks, DS. DS wrote: > Hi there, > > i must create some xml with datetimes in it. It has to be of > the format '2001-12-17T09:30:47-05:00'. I don't find how ...

Error: invalid format "XML"
Hi, I am trying to output a result set to XML format. The documentation says it works something like this : Output to c:\test.xml Format XML I try this but I get an Error : ***Error: invalid format "XML" Am I doing something wrong? Thanks, Veselin Veselin, are you using the DBISQLC utility? AFAIK, this legacy C-based tool does not support the "newer" output formats like XML. If so, then you will have to use the Java-based DBISQL. HTH Volker "Veselin Ivanov" <vs@sonita.com> wrote innews:4936294f$1@forums-1-dub... > Hi, &...

"XML page cannot be displayed" added to XML Download
I'm using these lines to initiae a download of an xml file.  Response.Clear()Response.ContentType = "application/octet-stream"Response.AddHeader("Content-Disposition", _"attachment; filename=""" & varFileName & """")Response.Flush()Response.WriteFile(varFileName)   File looks fine in XML viewer just after created. But the output of the download, when viewed as XML, has the following, fully formatted http error imbedded in it:   XML page cannot be displayed Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh butto...

Web resources about - xml datetime format "2009-12-25T07:00:00" - sybase.powerbuilder.xml

Resources last updated: 12/14/2015 1:01:21 PM