开发者

c# webservice class response

I have class:

    public class LoginResponse
 开发者_如何学运维   {
        public String SessionID { get; private set; }
        public DateTime? ActiveTo { get; private set; }

        public LoginResponse()
        {
        }

        public LoginResponse(String sessionID, DateTime? activeTo)
        {
            this.SessionID = sessionID;
            this.ActiveTo = activeTo;
        }
    }

And i want to return this class as webservice response:

[WebMethod]
        public LoginResponse Login(String login, String password)
        {
            return new LoginResponse("a", null);
        }

The class LoginResponse is in other dll. What must i do, because i got an error??

The errors told that i must using attribute WebMethodAttribute or change root type using XmlRootAttribute, because LoginResponse refers to method or type


I have a solution:

I must change function name from login :) Now it's name is servicelogin and works fine :)

regards

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜