Skip to Content
avatar image
Former Member

SAP B1WS Login Service Program in C#

Hi,

I have created the program in C# for LoginService.



public partial class Login : System.Web.UI.Page

{

    LoginServices.LoginService Lgvsrv = new LoginServices.LoginService();

  

    string DatabaseServer = "NIKUNJ-PC";

    string DatabaseName = "NewMaster";

    string LicenceServer = "NIKUNJ-PC";

    protected void Page_Load(object sender, EventArgs e)

    {

    }

    protected void Login1(string abc)

    {

             string sessionID;

             Lgvsrv = new LoginServices.LoginService();

             sessionID = Lgvsrv.Login(DatabaseServer, DatabaseName, LoginServices.LoginDatabaseType.dst_MSSQL2008, true, "manager", "avr123",                                         LoginServices.LoginLanguage.ln_English, true, LicenceServer);

      

    }

    protected void btnconnect_Click(object sender, EventArgs e)

    {

     

                  Login1(TextBox1.Text);

                  MySample.GlbData.sessioniD = TextBox1.Text;

                  if (TextBox1.Text != "")

                  {

                      btnconnect.Enabled = false;          

                      btndiscon.Enabled = true;

                  }

    }

    protected void btndiscon_Click(object sender, EventArgs e)

    {

       // lblmsg.Text = "";

    

    }

    protected void btnlogin_Click(object sender, EventArgs e)

    {

        // this.Login();

        //  TextBox1.Text = Login

        //  MySample.GlbData.sessionID = TextBox1.Text;

    }

}

But it give me error image like,

i attach image which give me error.

e1.jpg

Thanks,

Nikunj

e2.jpg (364.4 kB)
e1.jpg (238.7 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Jan 13, 2015 at 10:22 AM

    Hi Nikunj,

    this is error is produced by wrong preferences for IIS / SBODI_Server.

    Make sure to follow the instructions in B1WS.doc ( contained in B1WS folder ) - especially the DCOMCNFG part.

    Apart from that it would be helpful to get the whole IIS error page ( error can also be connected to application pool or asp.net issues ).

    regards,

    Maik

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Nikunj,

      this is already a big step...

      This error is usually fixed by using the IP address of the license server ( with port 30000 ).

      Instead of :

      string LicenceServer = "NIKUNJ-PC";

      use the IP + port :

      string LicenceServer = "192.168.1.100:30000"; // Afaik In recent versions the port can be left out

      regards,

      Maik