472,805 Members | 4,092 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,805 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 2055
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*...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

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.