Last post Oct 06, 2016 01:16 PM by Chris Zhao
Oct 05, 2016 01:25 PM|zonkerman|LINK
I have an asmx web service (yes I know its old tech but no choice in the matter) I need to add a new class to for data transfers. Basically it will be used to pass into methods or return data. The class name is InspectionResults.
The class is built using an xsd file as required for the group I work with. After the web service is built and deployed, an asp.net web application will consume it for use. At after this, I have noticed the original name of the class InspectionResults
is not in the reference.cs file but rather its name has been changed to something like request15.
I would rather the asp.net web application use the original name of InspectionResults. Is there a way to stop the class name from being renamed to a meaningless name like request15 in the reference.cs file so consuming apps can use the real name?
Thanks in advance
Oct 06, 2016 01:16 PM|Chris Zhao|LINK
The default name of a data contract for a given type is the name of that type. To override the default, set the Name property of the DataContractAttribute to an alternative name.