Employers - Post Free Jobs
Forum guidelines
  • Home
  • »
  • WCF
  • »
  • Service xml serialization - xsd schema output
AuthorQuestion
Service xml serialization - xsd schema output
Posted on: 18 Dec 2012
Hi,

I've created a WCF web service and generated the xml serialization class with xsd.exe. My problem is that when I request the xsd from the service (http://localhost:59120/Service1.svc?xsd=xsd2) the element names are appended with "Field" does anyone know how to override these default names with the original element names?

<xs:sequence>
 <xs:element name="addressField" type="xs:string" nillable="true"/>
 <xs:element name="emailIdField" type="xs:string" nillable="true"/>
 <xs:element name="idField" type="xs:string" nillable="true"/>
 <xs:element name="itemsField" type="tns:ArrayOfArrayOfOrdersCustomerItemsItem" nillable="true"/>
 <xs:element name="nameField" type="xs:string" nillable="true"/>
</xs:sequence>

Regards Al

AuthorReply
Re: Service xml serialization - xsd schema output
Posted on: 20 Dec 2012  
Hi,

I've managed to fix this by regenerating my class (xsd.exe) using the f switch "/f[ields]" which generates fields instead of properties. By default, properties are generated.


http://msdn.microsoft.com/en-us/libr...v=vs.100).aspx

Source: http://forums.asp.net/p/1867094/5245...15760042769749

Employers - Post Free Jobs

SPONSORED BY

Offshore Software and Database Development
MCN is your source for developing solutions involving websites, mobile apps, cloud-computing, databases, BI, back-end services and processes and client-server applications.