我有一个核心服务和一个微服务。微服务引用核心 WCF 服务。当我添加引用时,references.cs包含将我的私有属性公开为公共的类,并且在我的所有属性上都有一个字段后缀
例如:
public string SMCD { get; set; } 成为 private string sMCDField;
以下是我的参考类:
核心接口.cs
[ServiceContract(Namespace = Constants.Namespace, Name = "M3ApiCalls")]
public interface IService
{
[System.ServiceModel.XmlSerializerFormatAttribute()]
[OperationContractAttribute(AsyncPattern = true)]
IAsyncResult BeginCRS100MI_List(string Salesperson, decimal Timestamp, AsyncCallback asyncCallback, object state);
[System.ServiceModel.XmlSerializerFormatAttribute()]
CRS100MI_ListResult EndCRS100MI_List(IAsyncResult result);
...(more operations)
}
CRS100MI_ListResult.cs
[Serializable()]
[XmlSerializerFormat()]
[XmlRoot(ElementName = "CRS100MI_List",DataType = "System.Xml.XmlElement",Namespace = "http://companynamespace")]
public class CRS100MI_ListResult
{
[XmlElement(Order = 0)]
public string Result = "";
[XmlElement(Order = 1)]
public List<string> Messages = new List<string>();
[XmlElement(Order = 2)]
public List<M3Message> ResultMessage = new List<M3Message>();
[XmlElement(Order = 3)]
public List<CRS100MI_ListRecordResult> Record = new List<CRS100MI_ListRecordResult>();
public CRS100MI_ListResult Parse(List<Dictionary<string, string>> list)
{
//parses a list of dictionaries to CRS100MI_ListRecordResult
}
}
[Serializable()]
[XmlSerializerFormat()]
[XmlRoot(ElementName = "CRS100MI_ListRecord", DataType = "System.Xml.XmlElement", Namespace = "http://companynamespace")]
public class CRS100MI_ListRecordResult
在搜索了一之后,我偶然发现了以下 StackOverflow 问题: Why does WCF sometimes add "Field" to end of generated proxy types?
所以我确保按照给出的说明进行操作,但是在保存、重新添加服务引用并将其添加到 SOAPUI 之后,它仍然向我展示了这个问题。我究竟做错了什么?
动漫人物
相关分类