Web服务的登录表单返回null session_id

时间:2018-06-06 13:40:41

标签: c# .net visual-studio web-services

我正在处理一个应用程序,它们应该从Web服务获取数据,然后在telerik网格中显示数据。我已经编写了所有代码来从Web服务获取数据,但在某些方面我无法继续下去,因为我遇到了没有返回session_id的登录方法的问题。

        private string login_f()
    {
        string username = "WebServiceC";

       deltaServer service = new deltaServer();

        string password = "111111111111111111111111";
        string session_id = service.LOGIN(username, password, "dr", "NON");

        return session_id;
    }

以上是我登录方法的代码。

    public string LOGIN([System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] 
        string USERNAME, [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] 
        string PASSWORD, [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] 
        string LANGUAGE, [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] 
        string CHANNEL)
    {
        object[] results = this.Invoke("LOGIN", new object[] {
                    USERNAME,
                    PASSWORD,
                    LANGUAGE,
                    CHANNEL});
        return ((string)(results[0]));
    }

这是我的Reference.cs文件中登录的代码。奇怪的是,在我的应用程序的其他地方,这工作正常。在这种情况下,session_id返回NULL。 知道我哪里做错了以及如何解决这个问题?我会感激每一个答案,因为我被困了2天

0 个答案:

没有答案