none
Duplicated class in my WCF proxy RRS feed

  • 问题

  • Hi...

    I'm new to WCF development and these days I'm trying to develop my first WCF application. Yesterday, when I was generate the proxy class by using svcutil (svcutil http://localhost:8085/CustomerService /out:c:\clientcode.cs /config:app.config) then I just found there are two duplicated class out there...

    Sever Side:

        [ServiceContract]

        public interface ICustomerService
        {
            [OperationContract]
            QueryCustomerResponse QueryCustomer(QueryCustomerRequest request);

        [DataContract]
        public class QueryCustomerRequest : RequestMsg
        {
            [DataMember()]
            public int MarketId { get; set; }

            [DataMember()]
            public DateTime FromDate { get; set; }

            [DataMember()]
            public DateTime ToDate { get; set; }

    Client Side:

    As you can see in following bits, there are two classes, one object name is QueryCustomerRequest and the other one is QueryCustomerRequest1, however I've never defined the second object (QueryCUstomerRequest1) in service side, can someone help to solve this issue?

        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        QueryCustomerResponse1 ICustomerService.QueryCustomer(QueryCustomerRequest1 request)
        {
            return base.Channel.QueryCustomer(request);
        }

        public QueryCustomerResponse QueryCustomer(QueryCustomerRequest request)
        {
            QueryCustomerRequest1 inValue = new QueryCustomerRequest1();
            inValue.request = request;
            QueryCustomerResponse1 retVal = ((ICustomerService)(this)).QueryCustomer(inValue);
            return retVal.QueryCustomerResult;
        }

    Thanks!

    2015年6月12日 0:05

答案