Community
Showing results for 
Search instead for 
Do you mean 
Reply

ACT Remote PHP Connection

Copper Contributor
Posts: 61
Country: United_Kingdom

Re: ACT Remote PHP Connection

I will use it as Reader for time being since I already told my managers that I will finish the project in couple of weeks now its due and they are asking me for results.

 

I created simple ones already but how will I extract and import data to ACT, can you explain this part to me? Also how will I make these two web services to communicate with each other ?

Bronze Super Contributor
Posts: 1,284
Country: USA

Re: ACT Remote PHP Connection

You could create the select stalement on the PHP server do only include rows modified since the last pull.

 

I prefer more validation and always push back the GUID to the web service so it does not send the same row back the next query.

 

' get data from the web service

Dim ds as dataset =

m_WebAdminDurkin.GetTrialRegistrations("user","pass")

 

' Dim outside the loop for speed.

Dim cContact As Act.Framework.Contacts.Contact = nothing

 

' Walk the rows from the PHP server

for each row as datarow in ds.tables(0).rows

     ' Import each row into ACT

'----------------------------------------------------------------

' Get the contact VIA email

'----------------------------------------------------------------

 cContact = Durkin.Common.Classes.Contacts.GetContactbyCriteria(Email.HostFramework,

"TBL_CONTACT", "BUSINESS_EMAIL", OperatorEnum.EqualTo, cDataRow.Item("Email").ToString().Trim())

 

'---------------------------------------------

' Check if the contact was previously imported

'---------------------------------------------

If cContact IsNothingThen

Try

       cContact = Email.HostFramework.Contacts.CreateContact()

Catch ex As Exception

       LogError.Write(ex,

"ActFramework.Contacts.CreateContact")

ReturnFalse

EndTry

           

EndIf

 

 

'------------------------------------------------------------------------------------

' Always update the contact information to the latest information

'------------------------------------------------------------------------------------

cContact.FullName = cDataRow.Item(

"Contact").ToString()

cContact.Fields(

"TBL_CONTACT.BUSINESS_EMAIL", True) = cDataRow.Item("email").ToString()

cContact.Fields(

"TBL_CONTACT.BUSINESS_PHONE", True) = cDataRow.Item("Phone").ToString()

 

cContact.Update()

 

'------------------------------------------------------------------------------------

' Now push the PHP guid back to the PHP server

' where it stamps a TRUE in the 'isdownloaded' field

'------------------------------------------------------------------------------------

m_WebAdminDurkin.SetTrialRegistrations("user","pass", cDataRow.Item("PHPGuid").)

 

next

 

Using this push back validation the PHP select command sould look like so

"Select * from MyTable where isDownloaded is false"

 

Sorry for the formatting, this is all sudo code...

 

Hope this helps

-- Jim Durkin

Copper Contributor
Posts: 61
Country: United_Kingdom

Re: ACT Remote PHP Connection

Jim you lost me on the two web service communicating with each other, so far what I understand is 

 

1. I need to create a plugin that will extport my ACT databse table such as opportunities to a webservice

2. I need a PHP web service which will connect with the first service so that PHP will show the details to customer

3. Customer will do some changes and these changes will be saved on the PHP Webservice which will communicate with the ASP Webservice and update the changed parameters.

4. Same plugin or another plugin will read this ASP Webservice to import data into my ACT Database.

 

Now what I need to now is can I create a plugin for ACT in Visual Web Developer to export table data to Webservice ( or do I need a seperate plugin take out the data somewhere else than I will create a webservice based on that )?, how can I connect these two seperate web services ? and how do I push/import data to my ACT database, I think you sudo code answers this last part. 

 

Sorry if I sound a bit dull but I'm not very familiar with webservices.

 

Thanks 

Bronze Super Contributor
Posts: 1,284
Country: USA

Re: ACT Remote PHP Connection

Well, a lot depends on your server's OS.

Can you run asp.net on your primary web server?

Can you run MS SQL on your primary web server?

 

If both are yes then you can use the ACT OLEDB reader to populate the web page and push is back into the ACT DB using the ACTFramework.  This is the simplest because you do not have multiple databases to keep in sync. You would have ACT installed on your WebServer so the ASP.net page would use the ACTFrameworkto immediately submit those changes to the DB.

 

If the requirement is PHP and MySQL then life gets complicated quickly. You need to read the ACT database and store the information in your MySQL database. Using PHP you would populate the web page and submit those changes back to your MySQL DB.  Somewhere in the world you would have ACT running on a dumb PC with a plugin to poll your PHP server to pull down those changes.

 

Sorry I can not give more directions without knowing the complete scope of the project.

 

-- Jim 

 

 

Copper Contributor
Posts: 61
Country: United_Kingdom

Re: ACT Remote PHP Connection

Hi Jim,

 

To make things more clear. I have 2 servers one is based on Windows and has ACT and MSSQL on it and yes it's open for ASP.NET ( even i may install PHP for IIS on the server if this make things a bit easier ) other server which is shared Linux server is hosting our companies website on PHP and MySQL and i have very limited access on it. My goal as I mentioned before I need our customers to see their booking details and maybe change some fields on it. 

 

Is it possible for me to develop a plug in which will exctract all the ACT DB to a webservice which is based on PHP (since i can install PHP for IIS on my ACT DB machine) and will connect to anohter web service which is based on my webdomain than like you said in regular basis first service will check if there is any change on other service so that it will update itself and commit these changes to ACT DB.

 

If I can develop this project I will post it here Smiley Happy

 

 

Copper Contributor
Posts: 18
Country: New_Zealand

Re: ACT Remote PHP Connection

Hi Hysezer.

 

I realize that this is a bit of an old post by now but am not sure if you've heard of XData...it is a REST based API which we have built for ACT , it basically sits on top of the ACT SDK and provides an access point to some of ACT's main functions.

 

Here is a link to XData's Documentation, this also has a Demo database which you can work with if you want to give it a try

 

http://123.100.105.20/XData/Docs/

 

Being a REST based API it can work with PHP or anything that can communicate over the web.

 

Hope this helps!

Firas Hermez
Lead Developer
Xact Software Solutions ltd
www.twitter.com/xactsoftware
crminformer.blogspot.com
www.freeactaddons.com