Windows Vista Forums
Vista Forums Home Join Vista Forums Webcasts Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Indigo

svcutil /dconly

Update your Vista Drivers Update Your Drivers Now!!
 
 
Thread Tools Display Modes
Old 03-04-2006   #1 (permalink)
Damon Allison
Guest


 

svcutil /dconly

Hello,

We're trying to write our code in a "contract first" style. We want to
start with the .xsd files represnting our data structures and generate
the [DataContract] classes from them.

The process we are using is :

1. Create the customer.xsd representing our "customer" type.
2. svcutil /dconly /t:code customer.xsd
3. Create service contract that uses the generated [DataContract] code.
4. Generate the client proxy from the service using svcutil.
5. Run the client w/ the proxy.


I am having two problems generating the data contract. First,
everything is needed to be marked nillable. We are going to have
required elements and I don't want *everything* to be nillable. Second,
evidentially we cannot use facets in xsd other than enumeration. This
means we cannot enforce minLength/maxLength, pattern, etc.

These two problems seem rather big. Do I have options to get around
these? Will /useXmlSerializer work? If so, does anyone have an example
of an .xsd that uses facets and elements not marked with nillable?



Thanks,
Damon




With the schema below, svcutil returns the error :

Error: Enum type 'customer.lastNameType' in namespace
'http://vision/customer' cannot be imported. Facets other than
enumeration facets are not supported. Either fix the schema to conform
to [DataContract] rules or use ImportXmlType or use a different formatter



<?xml version="1.0" encoding="utf-8"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://vision/customer"
xmlns="http://vision/customer"
elementFormDefault="qualified">

<xs:complexType name="customer">
<xs:sequence>
<xs:element name="lastName" nillable="true">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="0" />
<xs:maxLength value="10" />
</xs:restriction>
</xs:simpleType>
</xs:element>

<xs:element name="firstName" type="xs:string" nillable="true" />
<xs:element name="middleInitial" type="xs:string" nillable="true" />
<xs:element name="age" type="xs:long" nillable="true" />
</xs:sequence>
</xs:complexType>

<xs:element name="customer" type="customer" nillable="true" />
</xs:schema>

My System SpecsSystem Spec
 

Thread Tools
Display Modes




Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51