0

So I am creating a web service application. I'm pulling data from a CSV file and displaying it via XML. However in my WSDL file, I cannot change the object names. Its basically a contract that prevents me from doing so. A header in the CSV file has just recently been changed from "Effective Date" to "User Effective Date." So when I run the xml file it is displaying effectivedate="02-15-06." I need to change effectivedate to usereffective date. Is there anyway to do this without changing my WSDL file? I'm not sure how clear my question is but any help is appreciated.

     /// <remarks/>
        [System.Xml.Serialization.XmlAttributeAttribute(DataType="date")]
        public System.DateTime effectiveDate {
            get {
                return this.effectiveDateField;
            }
            set {
                this.effectiveDateField = value;
            }
        }

Not sure if this helps any but this is the .cs code that is using the wsdl file.

    account.effectiveDate = DateTime.ParseExact(csv["User Effective Date"], "MM/dd/yyyy", new CultureInfo("en-US"));

    account.effectiveDateSpecified = (DateTime.ParseExact(csv["User Effective Date"], "MM/dd/yyyy", new CultureInfo("en-US")) > DateTime.MinValue);
AdamK
  • 63
  • 8
  • question would be more clear if you show part of the WSDL that need to be changed – Vladimir Jun 02 '16 at 16:14
  • added the wsdl code. The thing is I cannot change anything in the wsdl file (contract). I wasn't sure if there was a way I could make some type of alias that tells the program when you see effectivedate change the text to usereffectivedate. – AdamK Jun 02 '16 at 16:19
  • http://stackoverflow.com/questions/3653411/how-can-i-rename-class-names-via-xml-attributes might help you. But changing wsdl is a really bad idea, might try to to manually change received xml header of the recieved data. – Vladimir Jun 02 '16 at 16:25

0 Answers0