cancel
Showing results for 
Search instead for 
Did you mean: 

DI API with ASP.Net

Former Member
0 Kudos
274

Hi,

Can DI API be used to connect to SAP Business One database from an ASP.net application? Or is it required to use DI Server only?

Thanks,

Aparna

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Aparna:

the answer is DI-Server only. Thats the only way

Harold Gómez V.

Former Member
0 Kudos

The DI API can be used by a ASP.NET Web App or Web Server... I am not sure why Harold Says DI-Server only... Unless I am miss understanding the question... The DI-Server accesses the Data through the use of SOAP... But if you use the DI API you can access the data base through recordset objects or you can templete the recordset object by using buisness objects for easyer control of navigation and standard data functionality, ie, Updates, deletes, creates... If I am misstaken here please let me know... This is just how i have been doing things... thanks...

Former Member
0 Kudos

Hi Jeremy,

I tried using DI API in ASP.NET application but could not use it. So I was not sure if it can be used.

I get an error "Failed to Extract OBServer.dll from CAB File" on the oCompany.connect statement.

I could not find anything on this error in the forum. Do you know why I would be getting this message? I do not have much experience in ASP.NET

It will be much easier if I can use the DI API, I would appreciate any help.

Thanks,

Aparna

Former Member
0 Kudos

"Failed to Extract OBServer.dll from CAB File"

That is an interesting error... Not sure why your getting it but from the error message makes me wonder if you have things installed correctly and completely... As to connecting to a company... here is the code I use and it works for me...

<i>Try

vCmp = New SAPbobsCOM.Company

vCmp.Server = "XXXXX" 'Name of the DB Server

vCmp.CompanyDB = "XXXXX" 'Enter name of your company

vCmp.UserName = "XXXXX" 'Enter the B1 user name

vCmp.Password = "XXXXX" 'Enter the B1 password

vCmp.DbUserName = "XXXXX"

vCmp.DbPassword = "XXXXX"

vCmp.language = SAPbobsCOM.BoSuppLangs.ln_English 'Enter the logon language

vCmp.UseTrusted = False

' Activate connection

lRetCode = vCmp.Connect

' Make sure connection is successful

If lRetCode <> 0 Then

vCmp.GetLastError(lErrCode, sErrMsg)

Return sErrMsg

End If

Catch Ex As Exception

Return Ex.Message

End Try</i>

Hope this helps...

Former Member
0 Kudos

Hi Jeremy,

This is the exact code I am using. And interestingly, it works perfectly in my VB.NET application on the same machine. I am using a windows 2000 server.

I also tried on a different machine and received the same error.

I will try to uninstall and re-install but not sure if that will help.

Thanks,

Aparna

Former Member
0 Kudos

Jeremy:

tried your code, without success.

I've been trying to find the formal definition of why you have to use di server in an asp.net application but cannot remember the exact document.

What I remember is my SDK instructor telling us something about marshaling the observer.dll, and the use of the coonection pooling mechanism.

But I know for sure that, if you want to publish an application on internet, with access to SBO, you'll have to break several rules of security if you can use the di-api.

the rule of gold is, web project, use di-server to build web services. Then use asp.net or any other development language to consume those web services.

Harold Gómez.

Former Member
0 Kudos

Just wonder what version you are using... This code works with the 2005a SBO version we are using here... As for the DI Service... I have a question about that... We are wanting to use it but haven't been able to find any documentation that states that it works with UDO... I am assuming that it does... And the part about security, is interesting to know... Thanks for the information... Would like to go through a SDK training... Oh, well...

Former Member
0 Kudos

Jeremy,

Im also using 2005a PL6, I'm gonnatry on another station and let yopu know if the code works

and the UDO problem, cannot find the business object schema in the di server help, so, I dont thnik it will work.

Harold

Former Member
0 Kudos

I tried the code on a different machine and both with 2004 and 2005, but neither worked.

Aparna

Former Member
0 Kudos

Yeah, I really don't know, sorry... Its really strange that the code I posted doesn't work for you two but works fine for me... That just doesn't seem kosher... oh, well, sorry...

Former Member
0 Kudos

Jeremy,

Just a quick question, as I am still trying to troubleshoot this. Which version of IIS are you running? Is it 6.0?

Thanks,

Aparna

Former Member
0 Kudos

Running IIS V5.1...

Former Member
0 Kudos

I am getting a similar error when using DI API 2005 PL6:

"-8003: Obeserver dll version mismatch"

Any ideas in regards to this "dll hell"?

Thanks,

Bruno

Former Member
0 Kudos

Out of interest, I successfully wrote an aspx add-in which connected fine, in VB Web Developer Express Edition 2005.

The code for connecting above is identical to what I used.

Dan

Former Member
0 Kudos

Dan,

Did it work for you with DI API 2005?

I contacted SAP regarding this error and they have told me that this is a known issue for DI API 2005. It will be fixed in the next emergency patch release.

I then tried on 2004 and it works on 2004 version.

Aparna

Former Member
0 Kudos

Hi Aparna, we are also traying to connect a web app using DI API 2005, the client has SAP 2005 PL 04, do you know if with PL 11 this issue was corrected?. I am getting the 8003- Obeserver dll mismatch message.

If not, do you know how can we solve this??

Thanks