ReadXML from Compact Framework

Posts   
 
    
Anthony
User
Posts: 155
Joined: 04-Oct-2006
# Posted on: 15-Jan-2008 05:10:52   

Can i return a EntityCollection(writexml) to a Compact Framework device(readxml) ?

Using CF2 at mobile side and Net2 on web service side using llblgen 2.5. I get invalid cast when i try to readxml from mobile device. I can see that the entity has been returned ok to the mobile.

WEBSERVICE METHOD Dim adapter As New DataAccessAdapter Dim oExercises As New EntityCollection(Of ExerciseEntity) Dim XMLExercises As String = "" Try

        adapter.FetchEntityCollection(oExercises, nothing)

        oExercises.WriteXml(XMLExercises)

        Return XMLExercises

MOBILE COMPACT FRAMEWORK CODE

    Dim wsGymJunkie As New WS.Service1
    Dim oExercises As New EntityCollection(Of ExerciseEntity)
    Dim sReturn As String = ""

        sReturn = ws.SearchExercises(Me.txtbxExerciseKeyword.Text.Trim)

        oExercises.ReadXml(sReturn) **error InvalidCast
Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 15-Jan-2008 09:16:52   

Can i return a EntityCollection(writexml) to a Compact Framework device(readxml) ? Using CF2 at mobile side and Net2 on web service side using llblgen 2.5

According to the following threads, it should work: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=11562 http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=3039

Please post the exact exception text and stack trace.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39908
Joined: 17-Aug-2003
# Posted on: 16-Jan-2008 10:57:27   

Please use the overloads of readxml AND writexml which let you specify a format and for example date specifications and if <> containing textfields should be wrapped in CData blocks.

Frans Bouma | Lead developer LLBLGen Pro
Anthony
User
Posts: 155
Joined: 04-Oct-2006
# Posted on: 18-Jan-2008 03:36:49   

The webservice is using a different assembly namespace from the cf version..does this matter?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39908
Joined: 17-Aug-2003
# Posted on: 18-Jan-2008 10:19:20   

Anthony wrote:

The webservice is using a different assembly namespace from the cf version..does this matter?

If it has to re-create instances which are formulated with a full type name, then yes it does matter. If it has to re-create factory Foo.Bar.CustomerEntityFactory and on the service it's called Bar.Foo.CustomerEntityFactory, it can't recreate the instance.

Frans Bouma | Lead developer LLBLGen Pro