473,402 Members | 2,064 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

WS Proxy generator stripping out XSD annotation and enumerations

Hi there,

Here's the problem: our team is working on a web service which formerly
took in two user defined types consisting of mostly simple datatypes.
Recently we decided to move toward an XML schema to define the two types and
the required values to submit rather than having to send .NET-specific types.
So one of our team members generated an XSD with substantial annotation
explaining to consumers of the web service what each element was and why it
was there. There was also one element which had been an enumeration, so he
created a simple type and using restriction specified two integer enumeration
values. The schema validates just fine, but when a client generates a proxy
request through a web reference in VS.NET 2003, all of the annotation
elements are stripped out in the proxy xsd file, as is the enumerated simple
type. The one element which had been specified as that simple type now is
specified as able to accept any int value.

Is this a known issue with VS.NET? For what we are hoping to accomplish,
it's a huge deal breaker.

Please advise.

Thanks very much,

The Man From SQL

May 17 '06 #1
3 2110
Hi,

Could you let me know how you apply the schema to the class? Are you using
the xsd.exe to generate the class? If so, could you post your schema here,
so that I can have a try to repro the problem?

Kevin Yu
Microsoft Online Community Support

================================================== ==========================
==========================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
================================================== ==========================
==========================

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

May 18 '06 #2
Hi Kevin,

Thanks for your reply. Please try the following to replicate the problem.

1. Create a simple web service.
2. Add an XSD to that web service.
3. In the XSD, create a simple type called smplEnum based on the integer
datatype and constrain it as an enumeration so that there are only two or
three valid values for that simple type. Somewhere in your schema, create an
element myValue of type smplEnum.
4. Generate a dataset from this XSD. At this point if you open up the
code-behind file you'll notice that the property myValue is listed as an
integer and your enumeration is lost (problem #1).
5. In your web service, create a method which returns the typed DataSet you
generated from your XSD. Build the web service.
6. Now create a small console application and add a web reference to your
web service. The XSD will pull down, as well as the Reference.cs file. Now
not only is your code-behind file missing the enumeration on the client side,
too(problem #1), the simple type you created is now also missing from your
XSD (problem #2). An additional problem is that if you added any annotations
to your XSD file describing the elements on the server side, they are also
stripped out of the client-side XSD (problem #3).

Please let me know if you need any more information to replicate the problem.

Thanks,

Kerry

"Kevin Yu [MSFT]" wrote:
Hi,

Could you let me know how you apply the schema to the class? Are you using
the xsd.exe to generate the class? If so, could you post your schema here,
so that I can have a try to repro the problem?

Kevin Yu
Microsoft Online Community Support

================================================== ==========================
==========================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
================================================== ==========================
==========================

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

May 19 '06 #3
Hi Kerry,

The enum type in the XSD was mapped to int because when generating DataSet,
all items are mapped to DataSet columns. Since a DataColumn cannot accept
an enum type as data type, the enum type is mapped to int. The annotations
are stipped out by design to reduce size and communication costs.

Kevin Yu
Microsoft Online Community Support

================================================== ==========================
==========================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
================================================== ==========================
==========================

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

May 22 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: b_prikls | last post by:
Hi all, i need your help, here is code, that makes http connection to a website throu a proxy server, and it works fine: ========================================== $proxy = "111.111.111.111";...
2
by: SA | last post by:
Hi all, in the following situation: <xs:element name="Type"> <xs:simpleType> <xs:restriction base="xs:NMTOKEN">
0
by: XSD-optimist | last post by:
I am trying to generate the classes for an XSD schema using the Microsoft XSD Object Code Generator (XSDObjGen). I am having a schema that contains the definition of the following: 1. a complex...
1
by: wayne_bradney | last post by:
I have the following Schema (XMLSchema1.xsd): <?xml version="1.0" encoding="utf-8" ?> <xs:schema id="XMLSchema1" targetNamespace="http://tempuri.org/XMLSchema1.xsd"...
5
by: Benne Smith | last post by:
Hi, I have three enviroments; a development, a testing and a production enviroment. I'm making a big application (.exe), which uses alot of different webservices. I don't use the webservices...
8
by: Joe | last post by:
I have a web service which returns many types (classes) to match the return type. I want to cast the return type to the actual class type. For example: namespace Test { class MyClass { ...
0
by: George Bool | last post by:
Hello, I have a simple webservice that accepts a network credential as an argument to a webmethod. When i create a proxy for my client to use, the proxy generator then recreates a new type ...
0
by: Richard Gregory | last post by:
Hi, I have the wsdl below, for an Axis web service, and when I select Add Web Refernce in Visual Studio the proxy is missing a class representing the returnedElementsType (see reference.cs below...
1
by: neokosmos | last post by:
I've seen various generator-based microthread implementations online, but I've been wondering: has anyone used microthreads in this manner in a game environment? Note, I am emphatically *not*...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.