Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 2136

Web Service SAP BO

$
0
0

HI

 

 

I am creating a web service from asp.net, very simple, to create a seat ("Memo") using the Di API. But when testing sends me error "entry code ReferenceException not control Null".

 

 

The code is as follows:

 

 

<WebMethod()> _

    Public Function prueba(ByVal msje As String) As String

 

 

        Dim lRetCode As Long

        Dim vDoc As SAPbobsCOM.JournalEntries

 

 

        vDoc = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oJournalEntries)

        ' vDoc = oCompany.GetBusinessObject(oJournalEntries)

 

 

        oCompany = New SAPbobsCOM.Company

        oCompany.DbServerType = SAPbobsCOM.BoDataServerTypes.dst_MSSQL2008

        oCompany.DbUserName = "XXXX"

        oCompany.DbPassword = "XXXX"

        oCompany.Server = "192.168.0.XX"

        oCompany.CompanyDB = "SBO_INFORMATICA"

        oCompany.UserName = "XXX"

        oCompany.Password = "XXX"

        oCompany.UseTrusted = False

        'oCompany.language = "ln_Spanish_La"

 

 

        lRetCode = oCompany.Connect()

 

 

        vDoc.Memo = msje

        vDoc.Lines.Debit = 2000

        vDoc.Lines.Credit = 2000

        lRetCode = vDoc.Add()

 

 

        If lRetCode <> 0 Then

            oCompany.GetLastError(lErrCode, sErrMsg)

            MsgBox(lErrCode & " " & sErrMsg)  ' Display error message

        Else

            MsgBox("Asiento Creado", MsgBoxStyle.Information)

 

 

        End If

        oCompany.Disconnect()

 

    End Function

 

 

The idea is then to consume this web service from a web application. (ASP.NET)

 

 

thanks.


Viewing all articles
Browse latest Browse all 2136

Latest Images

Trending Articles



Latest Images