cancel
Showing results for 
Search instead for 
Did you mean: 

Need help: Connection to SBO-Common has failed

Former Member
0 Kudos

Hi to all,

I'm having problems to connect to the database server trough webservices.

I'm using: Windows XP, IIS 5.1, .NET 1.1 and VS2003

and: SBO2004A with DI API

When I invoke the webservice Connect() I get the following message: Connection to SBO-Common has failed.

This is my code:


Public Class Service1

    
    Inherits System.Web.Services.WebService

    Dim sErrMsg As String
    Dim lErrCode As Integer
    Dim result As String
    Public oCompany As SAPbobsCOM.Company

    
    <WebMethod()> _
    Public Function Connect() As String

        result = ConnectToCompany()
        Return result

    End Function

    Private Function ConnectToCompany()

       
        oCompany = New SAPbobsCOM.Company

        oCompany.Server = "(local)"
        oCompany.CompanyDB = "SBODemo_US"
        oCompany.UserName = "manager"
        oCompany.Password = "manager"
        oCompany.language = SAPbobsCOM.BoSuppLangs.ln_English

        oCompany.UseTrusted = True

        oCompany.Connect()

        '// Check for errors during connect
        oCompany.GetLastError(lErrCode, sErrMsg)
        If lErrCode <> 0 Then
            Return sErrMsg
	Else
            Return "Success"
        End If

    End Function


End Class

Tkx in advance.

Vítor

Accepted Solutions (0)

Answers (7)

Answers (7)

Former Member
0 Kudos

Hi Vitor,

This can be because the SBO version differs from your DI API, try using the ip and not server name, try UseTrusted =false. and the set the DBType to 4 or 6 (it depends).

This would be the common problems...

Former Member
0 Kudos

Solution: Changed some configs in SQL and I eventually got it to connect.

Former Member
0 Kudos

Hi All,

Please help,

I have a SAP Server with B1 2007 on and we have web site source code on a old web server that we want to move to the new web server.

Get the error -111 Failed to connect to SBO Common...

The old web server DIAPI test app I wrote works but on the new web server it doesn't

1. The ports is opened

2. I can ping the SAP server and access the DB's through sql.

Any ideas please ?

Former Member
0 Kudos

Hi, I happened to the same problem.

And I give right to DCOM SBOLicense.

But the error message changes to 'Error initializing the DB layer.'

Who can tell me how to solve this problem.

Thanks.

Former Member
0 Kudos

Tkx guys!

Well... the fiscal period is updated and I've tried the DbUserName and DbPassword but I get the same error.

I've also replaced the server name "(local)" with my actual server name and nothing!

Any more tips?

Tkx,

Vítor.

Former Member
0 Kudos

Just another validation...

Is the DI API version same as the SAP B1 server version?

Regards,

Ibai Peñ

Former Member
0 Kudos

I had the same problem with 2005. The solution was using the userid & password, dbusername & password AND changing UseTrustedLink to False (I do not know what effects this might have otherwise!!)

Former Member
0 Kudos

Once again tkx guys.

The DI API version is the same as the SBO version.

In fact, I can connect to the server on a normal project, I only have this problem developing the web service!

I've also tried the username & password, dbusername & password and changed the UseTrustedLink to false, but I got the message "Access denied".

I'm developing the webservice on a ASP.Net Web Service project. Can this be the problem?

Tkx.

Regards,

Vítor.

AdKerremans
Active Contributor
0 Kudos

Hi Vitor,

Is SBO running on a windows 2003 server?

Is the firewall on one or more machines active?

It looks like your code is correct, but something (probably access right or firewall) prevents you from connecting.

Regards

Ad

Former Member
0 Kudos

Hi Ad,

I'm running everything locally on Windows XP Pro.

Regards,

Vítor.

Former Member
0 Kudos

Hi Vitor,

Perhaps you should try adding the ASP.Net user to the DCOM rights. This one is the user which uses the webservice, and should have rights to execute the SBOLicence DCOM.

Regards,

Ibai Peñ

Former Member
0 Kudos

Tkx Ibai.

I was already wondering around the user rights and that was it!

The problem was all about the ASP.Net user.

(I can't find the reward points! Is it because this topic wasn't created as a question?)

Regards,

Vítor.

Former Member
0 Kudos

I´m happy about helping you.

Don´t worry about the points... Just help other people (and me) if you can.

Regards,

Ibai Peñ

Former Member
0 Kudos

Hi Vitor,

Perhaps you should try adding the ASP.Net user to the

DCOM rights. This one is the user which uses the

webservice, and should have rights to execute the

SBOLicence DCOM.

Regards,

Ibai Peña

God I need to try this. I've been looking for a solution to that problem since a few days. I hope I will succeed

Former Member
0 Kudos

Marc,

Did you ever fix this? Myself and another programmer have been going thru the same agony. I think the issue is that we're developing on workstations and the License Server is on another machine.

We're not in the domain, but can authenticate to the other machine. That other machine (License machine) seems not to be able to authenticate our local web user (ASPNET) for the license verification.

I'm pulling what is left of my hair out over this - any ideas?

Former Member
0 Kudos

Hi Expert,

Am facing the same issue for the moment. I had develop a web services application using VB2005, tried it out at ASP.NET development server and it works fine. But, once i copy the folder and transfer to IIS server, error occurs, 111 - Failed to Connect to SBOCommon. Any clues for this?

Thanks.

Regards,

Yean

AdKerremans
Active Contributor
0 Kudos

Hi Vitor,

Try settingthe DbUser and DbPassword properties of the company.

Regards

Ad

former_member184566
Active Contributor
0 Kudos

Hi Vítor Oliveira

I do not see anything wrong with your code, the only thing i can think of is that you are trying to connect to the demo database. But that demo database is old, if you log into it through the front end you'll see the fiscal period is old. Add-ons will NOT connect to companies where the fiscal period is not valid. So either make new fiscal/financial period or connect to a db that has valid fiscal periods.

Hope this helps