473,796 Members | 2,550 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2154
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
5574
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"; $port = "8080"; $url = "http://www.myhost.com/folder/script.dll?variable=hello";
2
2301
by: SA | last post by:
Hi all, in the following situation: <xs:element name="Type"> <xs:simpleType> <xs:restriction base="xs:NMTOKEN">
0
1841
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 type 'ExternalDestinationBaseComplexType' 2. abstract element 'ExternalDestinationDefinitionEntry' of type 'ExternalDestinationBaseComplexType' 3. two elements 'SAP' and 'Dir' of type ExternalDestinationBaseComplexType with substitutionGroup set...
1
2289
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" elementFormDefault="qualified" xmlns="http://tempuri.org/XMLSchema1.xsd" xmlns:mstns="http://tempuri.org/XMLSchema1.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:simpleType name="FruitType">
5
3488
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 by adding a WebReference, since it does not allow me to keep state (cookiecontainer) or to specify functions on the classes (like if i want to override the ToString() function on a class from my webservice). So the only way i can see how i can get...
8
3654
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
1008
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 mywebservicename.networkcredential such that when i try to pass a system.net network credential to the
0
5115
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 the wsdl). This complex type is a collection of another complex type(elementType), and the Reference.cs has an array of these rather than the single returnedElementsType. If If I want to be able to obtain these elements from the SOAP response I...
1
2158
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* referring to Stackless, which I know has been used in a production game environment; this post is referring strictly to the standard Python interpreter, (v. 2.4 or 2.5 as you wish). I intend to try a little cooperative microthreading implementation...
0
9531
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10459
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10237
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10187
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10018
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7553
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6795
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5578
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3735
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.