ASMX web proxy class changing class name from PascalCase to camelCase - visual studio 2019

会有一股神秘感。 提交于 2021-01-29 09:10:07

问题


We had a legacy asmx web service (2.0 framework) which were migrated to 4.8 framework.

[WebMethod]
        public virtual GetCreditPolicyResponse GetCreditPolicy(GetCreditPolicy getCreditPolicy)
        {
            return organisationStrategy.GetCreditPolicy(getCreditPolicy);
        }

Class definition :

 public class GetCreditPolicy
    {
        public GetCreditPolicy();

        public int RecognitionId { get; set; }
    }

Now while we are generating the wsdl of this we are getting the following :

<s:element name="GetCreditPolicy">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" ref="s1:getCreditPolicy"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="getCreditPolicy">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="RecognitionId" type="s:int"/>
</s:sequence>
</s:complexType>
</s:element>

In the proxy class we are getting the following :

[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.17929")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://www.es.org/he/recognitions/dataobjects.xsd")]
public partial class getCreditPolicy {
    
    private int recognitionIdField;
    
    /// <remarks/>
    public int RecognitionId {
        get {
            return this.recognitionIdField;
        }
        set {
            this.recognitionIdField = value;
        }
    }
}

Here the original class "GetCreditPolicy" is getting changed to "getCreditPolicy" in the web proxy class/reference. Really not a single clue why this is happening.

Thanks is advance for any guidance on this.

来源:https://stackoverflow.com/questions/65086700/asmx-web-proxy-class-changing-class-name-from-pascalcase-to-camelcase-visual-s

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!