CF.NET and XMLWebService

  • Thread starter Thread starter Alex
  • Start date Start date
A

Alex

Hello,

Is it possible to return from XML Web Service DataSet for CF.NET caller?
I've been forced to use XmlDataDocument to convert DataSet to XmlElement and
after that returns it to caller.
Is it right solution?

Alex.
 
You definitely cannot return a Typed DataSet
(one that has an XSD schema associated with it).
I think you can return an untyped DataSet ...

I usually do your XmlDataDocument trick myself.

Thanks,
casey
http://www.brains-N-brawn.com
 
Alex,

You sure can return (and pass) untyped DataSet.

[WebMethod]
public DataSet GetMyDataSet() {

DataSet ds = new DataSet();

// Get data to the DataSet here...

return ds.
}

Typed DataSet's are not supported by CF, so you should not use them (though
you can if you really really need it).

Using XmlDataDocument is a very bad idea from performance point of view.
It's not great by itself, and XmlDataDocument will make it even worse.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
 
Hello Alex,

and thank you for your answer. But I'm not agree with you about it. I've
written the following web method.

[WebMethod]
public DataSet GetClassifiers()
{
...
return myDataSet;
}

Using this code snippet I was calling the method:

_TMSMain = new TimeMangementServices.Main();
_TMSMain.Url = "http://...";
DataSet ds = _TMSMain.GetClassifiers(); // there throws
PlatformNotSupportedException

I'm using WindowsCE 4.1 Emulator (which is comming with VS.NET 2003).
Maybe I should upgrade my emulator to 4.2? If it's so, where I can find
useful resource?

Thnx,
Alex

"Ilya Tumanov [MS]" said:
Alex,

You sure can return (and pass) untyped DataSet.

[WebMethod]
public DataSet GetMyDataSet() {

DataSet ds = new DataSet();

// Get data to the DataSet here...

return ds.
}

Typed DataSet's are not supported by CF, so you should not use them (though
you can if you really really need it).

Using XmlDataDocument is a very bad idea from performance point of view.
It's not great by itself, and XmlDataDocument will make it even worse.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: "Alex" <[email protected]>
Subject: CF.NET and XMLWebService
Date: Tue, 13 Apr 2004 14:10:38 +0300
Lines: 10
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
NNTP-Posting-Host: 80.81.33.28
Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12
phx.gbl
Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.framework.compactframework:50863
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

Hello,

Is it possible to return from XML Web Service DataSet for CF.NET caller?
I've been forced to use XmlDataDocument to convert DataSet to XmlElement and
after that returns it to caller.
Is it right solution?

Alex.
 
Alex,

This exception has nothing to do with CF's ability to get DataSet from WS
(which is definitely supported and used by many).

Here's a quote from my other post:
-----
This error usually means you're trying to use locale, which is not
supported by hardware.
For example, attempt to use DataSet with Hebrew locale on US device would
result in this exception.
The locale of the DataSet, returned by Web Service will be set to the
server's default locale.

Solutions:

1. Change DataSet's locale on the server to locale supported by your device:

ds = new DataSet( );
ds.Locale = new CultureInfo ("EN");

2. Change thread locale on the server to locale supported by your device:

public DataSet RetrieveHospital()
{
Thread.CurrentThread.CurrentCulture = new CultureInfo ("EN");
-

3. Use localized device which supports your server's locale.
---

You could also change server locale, but that's normally not an option.


Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
Subject: Re: CF.NET and XMLWebService
Date: Wed, 14 Apr 2004 10:03:13 +0300
Lines: 91
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
NNTP-Posting-Host: 80.81.33.28
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.compactframework:50918
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

Hello Alex,

and thank you for your answer. But I'm not agree with you about it. I've
written the following web method.

[WebMethod]
public DataSet GetClassifiers()
{
...
return myDataSet;
}

Using this code snippet I was calling the method:

_TMSMain = new TimeMangementServices.Main();
_TMSMain.Url = "http://...";
DataSet ds = _TMSMain.GetClassifiers(); // there throws
PlatformNotSupportedException

I'm using WindowsCE 4.1 Emulator (which is comming with VS.NET 2003).
Maybe I should upgrade my emulator to 4.2? If it's so, where I can find
useful resource?

Thnx,
Alex

"Ilya Tumanov [MS]" said:
Alex,

You sure can return (and pass) untyped DataSet.

[WebMethod]
public DataSet GetMyDataSet() {

DataSet ds = new DataSet();

// Get data to the DataSet here...

return ds.
}

Typed DataSet's are not supported by CF, so you should not use them (though
you can if you really really need it).

Using XmlDataDocument is a very bad idea from performance point of view.
It's not great by itself, and XmlDataDocument will make it even worse.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: "Alex" <[email protected]>
Subject: CF.NET and XMLWebService
Date: Tue, 13 Apr 2004 14:10:38 +0300
Lines: 10
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
NNTP-Posting-Host: 80.81.33.28
Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12
XmlElement
and
 
Back
Top