Skip to Content
author's profile photo Former Member
Former Member

DI / JCo: Error using SBOBob.GetItemPrice() from webservice

I am trying to use the SBOBob.GetItemPrice() function from a webservice but it keeps raising an error when I call it. The error is:


ErrorCode: -2147417851

Message: "The server threw an exception."

Using it from the sample project '3.UsingSBObob' works fine.

Can anyone confirm if they have the same problem or better, give me a solution?


<WebMethod()> _

Public Function GetItemPriceTest() As String

Dim oCompany As SAPbobsCOM.Company = New SAPbobsCOM.Company

oCompany.Server = ConfigurationSettings.AppSettings("SBOServer")

oCompany.CompanyDB = ConfigurationSettings.AppSettings("SBODatabase")

Dim dbUserName As String = ConfigurationSettings.AppSettings("SBODBUserName")

If (dbUserName.Length > 0) Then

oCompany.UseTrusted = False

oCompany.DbUserName = dbUserName

oCompany.DbPassword = ConfigurationSettings.AppSettings("SBODBPassword")


oCompany.UseTrusted = True

End If

oCompany.UserName = ConfigurationSettings.AppSettings("SBOUserName")

oCompany.Password = ConfigurationSettings.AppSettings("SBOPassword")


oCompany.GetLastError(m_lastError, m_lastErrorMsg)

If m_lastError <> 0 Then

Throw New Exception("Error", Nothing)

End If

Dim oBridge As SAPbobsCOM.SBObob = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoBridge)

Dim oRs As SAPbobsCOM.Recordset = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)

' This one raises an error

oRs = oBridge.GetItemPrice("C1000", "A1000", 100D, Now)

Return oRs.Fields.Item(0).Value & " " & oRs.Fields.Item(1).Value

End Function

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on May 24, 2004 at 02:20 PM

    Update of the poster:

    The other methods of the SBOBob object seem to work correctly in the webservice, only the GetItemPrice() method raises an error.

    Anyone brave enough to test this in Visual studio .NET?

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 26, 2004 at 03:31 PM

    Update of the post

    The problem only occurs on Windows Server 2003 in a webapplication. This has probably something to do with IIS 6.0 (instead of IIS 5.0 on a windows 2000/XP).

    Can anyone test this on Windows Server 2003 to see if they have the same problem?

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Tom,

      as stated in our communication outside this forum, I could reproduce this error.

      Regrettably this issue is likely not to be fixed in 6.5 as Windows Server 2003 will first be officially supported by the next release!

      Check it out in the "Product Availability Matrix" (PAM) on "SAP Service Marketplace" (SMP):

      Enter /sbo-swcenter and then in the menu on the right (?) side: "Support Packages & Patches" / "SAP Business One Releases prior to SBO 2004"

      Now see the text below "SAP Business One Releases prior to SBO 2004".

      There's a link to the "PAM"...



Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.