I
I
Ivan Vyrov2018-10-10 13:48:27
C++ / C#
Ivan Vyrov, 2018-10-10 13:48:27

What is the error when using wrapper class for WCF?

Dear experts, a big request to prompt with the following questions:
There is a class "wrapper" for the results returned by WCF

Class code
public class ClassResultInfo
    {
        [DataMember(Name = "Статус")]
        public bool Status { get; set; }
        [DataMember(Name = "Тип_Результата")]
        public Type TypeResult{ get; set; }
        [DataMember(Name = "Результат")]
        public object Result { get; set; }
        [DataMember(Name = "Ошибка")]
        public string Error { get; set; }

        public ClassResultInfo()
        {
        }

        public ClassResultInfo(bool status, string error)
        {
            Status = status;
            TypeResult = null;
            Result = null;
            Error = error;
        }

        public ClassResultInfo(bool status, Type typeResult, object result)
        {
            Status = status;
            TypeResult = typeResult;
            Result = result;
            Error = string.Empty;
        }

        public ClassResultInfo(bool status, string error, Type typeResult, object result )
        {
            Status = status;
            TypeResult = typeResult;
            Result = result;
            Error = error;
        }
    }
WCF interface code
public interface IAisaServer
    {
        [OperationContract(Name = "Мониторинг")]
        ClassResultInfo MonitoringServiceList(User user, bool isActive);
    }

When I try to test through WcfTestClient.exe I get the following picture
Screen
5bbdd7906f79a399786428.png

When I try to call a method through the client code - during the method call I get the following error
System.ServiceModel.CommunicationException: "The socket connection was aborted. This could be caused by a message processing error, a timeout on the remote host, or a network resource allocation issue. Local socket timed out: '00:00:59.9659980'."

With all this, the Test() method works as expected.
As I understand it, C# cannot serialize the "wrapper" class? Tell me where to dig.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Yudakov, 2018-10-12
@AlexanderYudakov

Serialization is not to blame here.
The text of the message clearly states: The WCF client failed to connect to the WCF server in 1 minute.
PS And why did you paint over the screenshot? There is just the most interesting information.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question