问题
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