PDA

View Full Version : Problem in back office API login



nhasan
04-29-2014, 11:01 AM
Dear Team

Recently I have received my back office demo account.
Username: naeem-1
Password: 1234
Server IP: 74.54.46.178
Port: 4401

I can log in my account from Vertex10 Backoffice, but when try to execute Login() function from VB.Net code - it's not working.
I am using VB.Net 2010 sample code given in back office API tool kit.

MGeneral.m_oBOAPI.SetLoginInfo("naeem-1", "1234", "74.54.46.178", 4401)
MGeneral.m_oBOAPI.Login()
MsgBox(m_oBOAPI.LogedOn)

This always shows "False" on message box.

Is there anything wrong or missing to start with back office API application?

Thanks
Naeem Hasan

Hassan-HS
04-29-2014, 11:57 AM
Dear Naem,

In some cases Windows vista/Windows 7 prevent some executable codes from running/executing probably. This happens because of Data Execution Prevention (DEP) this happens in some cases.

To disable the DEP please read this article (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/3540/0/experienced-windows-7-connectivity-issues)

nhasan
04-30-2014, 06:56 AM
Thanks
I can connect to my demo account now
But after logging on it shows two error from VertexFXBOAPI10 and HSClientDLL10 as shown in screenshot.333

Hassan-HS
04-30-2014, 07:01 AM
Hello Hasan,

Please tell me which version of BOAPI do you use?

nhasan
04-30-2014, 08:38 AM
I am using BOAPI10.1.11

Hassan-HS
04-30-2014, 08:47 AM
Dear Naem


Your API you are using is too old which is not compatible with VertexFX 10.2, Please upgrade it, you can contact our support department (http://www.hybrid-solutions.com/support/index.php?/Tickets/Submit) to get the latest BO API which is 10.2.0

nhasan
05-07-2014, 09:14 AM
Dear Hassan
Thanks for your advice, I have installed the updated version and can log in to my demo account naeem-1
It shows online sessions as well
Now I have two issue -
1. When I remain logged in from my own code ( like sample 2010 ) and a new client logged in (say nhasanbd) from client terminal that is not showing in my online session list, not even update count in OnlineSessions.Count property. But if I disconnect and reconnect in dealer account from my code then I can see that client(nhasanbd) in session list. I think the event SessionLogedON is not triggering for new client log in while dealer account remain online.
2. The DisconnectSession method is not working for client sessions. Say, I have two sessions in the list naeem-1 the dealer account and nhasanbd client account, I can disconnect naeem-1 but not nhasanbd.

Please advice how to overcome this issues and continue with back office API application development project.

Thanks

Hassan-HS
05-07-2014, 01:00 PM
Hello Naem,


Can I access your code let me check? Anyway check if you referenced your project with the latest version.

nhasan
05-08-2014, 04:05 AM
I have installed the latest version VertexFxBOAPI10.2.1 and using the sample code for VB.Net2010 where reference is set to Interop.VertexFXBOAPI10.dll in obj\Debug location.

Is there any other update for this API?

Hassan-HS
05-08-2014, 07:49 AM
Dear Naem,


We have updated you with the new DLLs, please check it and update me if every thing is OK now.

nhasan
05-08-2014, 08:41 AM
Dear Hassan

The latest version download from the given link in my mail : resolve one issue, it is now showing new clients in online sessions list but still I can't disconnect clients from the code. Function DisconnectSession works only for dealer(API) account, not for client logged in from client terminal.

[/SIZE][/FONT]

Hassan-HS
05-08-2014, 09:05 AM
Hello Naem,


I have tested and it's work.





' An event triggered when a new session logged on, that is when a new user looged on.
Private Sub m_oBOAPI_SessionLogedON(ByRef LogedSession As VertexFXBOAPI10.COnlineSession) Handles m_oBOAPI.SessionLogedON
m_oBOAPI.DisconnectSession(LogedSession)
End Sub

nhasan
05-08-2014, 09:10 AM
Did you test this function in frmMain form? It's not working for clients account

Private Sub Disconnect1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Disconnect1.Click
Dim LogedSession As VertexFXBOAPI10.COnlineSession
For Each LogedSession In m_oBOAPI.OnlineSessions
If LogedSession.Username = lvwSessions.SelectedItems(0).SubItems(2).Text Then
MGeneral.m_oBOAPI.DisconnectSession(LogedSession)
End If
Next
End Sub

Hassan-HS
05-08-2014, 09:49 AM
Dear Hasan,

Yes i have tested your sample and it's work like a charm :D

nhasan
05-08-2014, 09:57 AM
334

Sorry, the disconnect command shown in screenshot is not working in my test.
It can't disconnect the client nhasanbd logged in from client terminal
And it's not removed from this list
But it's works on Dealer account naeem-1

Hassan-HS
05-08-2014, 10:35 AM
Hello Naem,


It was a privilege issue, now you can disconnect any client. (the new password for your demo client is 1234)

nhasan
05-08-2014, 10:58 AM
Sorry to say that I can't disconnect client account NHASANBD from sample code.( Password for NHASANBD is still asdfg)
If it is a privilege issue, how can I set it for my client accounts so that they can be disconnected from API function?

Hassan-HS
05-08-2014, 03:00 PM
Dear,



Nothing to do, it's a dealer privilege.

nhasan
05-11-2014, 07:10 AM
Dear Hassan

Can you please update dealer privilege of 'naeem-1' so that I can disconnect any account under this dealer from VB.Net code?
I have tested it today and still I can't disconnect client account nhasanbd from VB.Net 2010 sample code.
But I can disconnect that client ( nhasanbd ) session from Vertex 10 Backoffice application.

Hassan-HS
05-11-2014, 02:44 PM
Hello,


I will check this case, and i will update you soon.


Note:Your dealer have the previlge to disconnect the clients

nhasan
05-12-2014, 09:54 AM
I am testing the sample code with two client session from two different IP, but I can't disconnect any of them!

Hassan-HS
05-12-2014, 10:12 AM
Hello,


Please check the returned value of the disconnect method which is of type CallingResultEnum, and update me with the result.

nhasan
05-12-2014, 10:24 AM
336
Result shown in MsgBox for rst = MGeneral.m_oBOAPI.DisconnectSession(LogedSession) command.

Hassan-HS
05-12-2014, 11:06 AM
Dear,

I will check this using your dealer.

nhasan
05-12-2014, 11:22 AM
I can disconnect my client account from Back Office application, but not from API Sample Code.
Please try to disconnect clients account from API sample code with my dealer account naeem-1

Hassan-HS
05-12-2014, 11:25 AM
Hello,


Please check that all accounts is not a demo accounts...

nhasan
05-12-2014, 11:42 AM
Yes, that may be
But I should have privilege to disconnect any account from API function call under the dealer account, right?

Hassan-HS
05-12-2014, 11:58 AM
Dear Naem,

That will be applicable in next version of API, which will be released soon.

nhasan
06-18-2014, 04:06 AM
Did you release next version of Back Office API?
Can I get the download link of latest version of API toolkit?

Hassan-HS
06-18-2014, 06:37 AM
Yes, contact our support department (http://www.hybrid-solutions.com/support/index.php?/Tickets/Submit) :) .

nhasan
06-24-2014, 04:18 AM
Thanks, I got the latest version of BO API

Now, another issue - how can we identify client's group, office, dealer using API function?
Also we need to identify user's platform from where they have logged in i.e Desktop Application, Web, Mobile from API - how to do that?

Hassan-HS
06-24-2014, 07:33 AM
You are welcome,



Now, another issue - how can we identify client's group, office, dealer using API function?


We already working on this, we will release a new patch within days that will support this feature...



Also we need to identify user's platform from where they have logged in i.e Desktop Application, Web, Mobile from API - how to do that?


Check the IP-Address property of the logged in session and API-Login property , this string identifies the user platform as following:


"10.20.30.40" and the APILogin=False : Desktop Application

"10.20.30.40" and the APILogin=True : Desktop Application thats use our API

"Web(10.20.30.40)" : Web

"Mobile(10.20.30.40)" : Mobile

Hassan-HS
07-01-2014, 10:39 AM
Hello Hasan,


We have released the new patch of Backoffice API ( 10.2.4 ), please contact our support department to get it.

Now you can identify if the client type using the ClientType property.

Sample


Dim Client As VertexFXBOAPI10.COClient
Dim ID As Integer = 1234
Client = m_oBOAPI.ClientByID(ID)
If Client IsNot Nothing Then
Select Case Client.ClientType
Case ClientTypeEnum.CLIENT_TYPE
MsgBox("Client")
Case ClientTypeEnum.OFFICE_TYPE
MsgBox("Office")
Case ClientTypeEnum.OTHER_GROUPS_TYPE
MsgBox("Group")
End Select
Else
If String.IsNullOrEmpty(m_oBOAPI.DealerUsername(ID)) Then
MsgBox("There is no client or dealer with this ID")
Else
MsgBox("Dealer")
End If
End If