Repost - Typed dataset returned from webservice incorrectly defined in proxy - null value problem

R

Randy Hayes

Repost...didn't get any responses on the first try...

I have a web service that has a xsd defined for a dataset. The xsd has all
of the proper tables/elements, constraints, relations, etc. and works fine
from the webservice standpoint. I have also defined certain elements in the
xsd to return empty when null.

Now I realize that this puts in some msprop attributes on those elements as
well as some codgen attributes all in place to help out the generation of
the typed dataset. And when looking at the dataset generated in the
webservice...it has the logic for the null values. All is well!

BUT, when referencing the webservice from an app, the proxy generated typed
dataset is not the same. It has no logic for the null values.

I noticed that when going to the webservice directly and requesting the
schema (webservice.asmx?schema=xxxx) the resulting schema DOES NOT include
all of the namespace information for the dataset generation. In other
words, not only is the namespace declaration missing, but all of the
attributes for the elements that were defined as returning "emtpy" when null
are missing. This explained why the proxy generated typed dataset was the
way it was.

My question...how (if at all possible) can this information be included in
the schema that is returned from the web service and thus returned to the
proxy generation?

Randy
 
M

MSFT

Hi Randy,

I have replied your previous post and stated this is a limitation in .NET
Web service proxy. For some reason, you may not see my reply. I repost it
here. If you have any further question, please feel free to post in the
newgroup.

From: (e-mail address removed) (MSFT)
Date: Tue, 20 Jan 2004 02:51:32 GMT
Subject: RE: Typed dataset returned from webservice incorrectly defined in
proxy - null value problem
Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices

Hi Randy,

Thank you for using MSDN Newsgroup. I am Luke and I am review this issue
currently. As I understand, your web service has a typed Dataset. When you
get the schema from proxy or "webservice.asmx?schema=xxxx", your found the
schema in result missed some attributes and namespace.

In fact, the support for XML schema is very limited here. The typical name
space are like:

<xs:schema id="DataSet1"
targetNamespace="http://www.tempuri.org/DataSet1.xsd"
xmlns:mstns="http://www.tempuri.org/DataSet1.xsd"
xmlns="http://www.tempuri.org/DataSet1.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
attributeFormDefault="qualified" elementFormDefault="qualified" >

Any other namespace will be ignored in the generated proxy. The attribute
in the other namespace is also ignored. This design is based on considering
of compatibility.

I think the work around is to import the xsd file in client project so that
we can get same definition for the type dataset.

Hope this help,

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top