The YYYY-MM-DDTHH:MM:SS format is from .NET’s default XML serializer, which uses something like an ISO date format (.NET’s format string “s”).   When you dump it on the server side, it is probably just using the object’s ToString() method, which seems like it chose a different format.  One question, I guess, is what schema data type the WSDL is telling Flex to expect.  Second question (to the Macromedia crew) is how Flex handles deserialization depending on what that schema data type is….

 

- Rick

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Matthew Shirey
Sent: Monday, June 27, 2005 6:41 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Flex, C# Web Services, and Dates

 

Thanks for the reply, I did try what you suggested just to be sure, but like I said before, it seems that by the time the result event handler has fired, the data is already bad.  I just cannot see why the XML in the SOAP response is:

<StartDate>2005-06-01T00:00:00</StartDate>

yet the object created is:

StartDate[Local Time] : Wed Dec 31 16:00:00 1969 (+0:00)


this just doesn't make any sense...

-- Matthew

On 6/27/05, Rick Bullotta <[EMAIL PROTECTED]> wrote:

Here's an example with an HttpService, you can do something similar:

 

Add:

 

result="manageData(event)"

 

…to your mx:HttpService tag…

 

Define the handler something like this, where it will look through the returned data structure and replace the StartDate objects with a "parsed" version…in my example, my structure is a multi-row XML document.  One of the elements is named "DateTime" and is in the same format you are trying to parse.  If you only have a single row, the handler might look slightly different.

 

function manageData(event) {

            for(var i:Number=0; i< event.result.Row.length; i++) {

                        var d:Date = parseDateString(event.result.Row[i].DateTime);

                        event.result.Rowsets.Rowset.Row[i].DateTime = d;

            }

}

                                   

- Rick


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Matthew Shirey
Sent: Monday, June 27, 2005 6:13 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Flex, C# Web Services, and Dates

 

Might you have some information on where to put this exactly?  It seems like it's too late by the time the object has been created from the result of the web service call.  All it seems to contain is "Invalid Date".  When I look at the object that was created in the Network Monitor, it does seem to have a date, but not the one I sent it. 

>From the network monitor, here's the date piece of the xml recieved in the SOAP "Response" entry:

<StartDate>2005-06-01T00:00:00</StartDate>

Here's the piece of the object created from the Network Monitor Web Service "onResult" entry :

StartDate[Local Time] : Wed Dec 31 16:00:00 1969 (+0:00)

as you can see, it doesn't even have the proper value in it.  I've created an onResult event handler to try to print out the value and all I get from obj.StartDate is "Invalid Date".

This one really has me stuck guys.  Any help would be greatly appreciated, thank you,

-- Matthew

On 6/25/05, Manish Jethani <[EMAIL PROTECTED]> wrote:

On 6/25/05, Rick Bullotta < [EMAIL PROTECTED]> wrote:

> Is there a way to use the import statement in "inline" script in an
> <mx:Script> block?  The compiler complains if we try this.

Yes, certainly.

  <mx:Script>
    import foo.Bar;

    function blah():Void
    {
      Bar.bar();
    }
  </mx:Script>

Must be something wrong with the way you are importing.  If you still
have the problem, you could post the exact compiler error.


--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
     [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/




--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com



--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





YAHOO! GROUPS LINKS

 

 





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




YAHOO! GROUPS LINKS




Reply via email to