09-01-2008 09:57 PM
09-04-2008 01:22 PM - edited 09-05-2008 12:51 PM
Sean,
I'm sure ACT for Web does most of this for you, but I created a VB.NET webservice (using Visual Web Developer 2005 Express) to interact with our ACT Database in order to populate data on a ASP website.
It's pretty straight-forward, actually. Just create your new webservice, put your Act.Framework.dll and Act.Shared.Collections.dll in your bin directory, and do something like:
Imports Act.Framework
Imports Act.Framework.Contacts
Public Class myWebService
Inherits System.Web.Services.WebService
Dim ActFwk As ActFramework = New Act.Framework.ActFramework
Dim sActUserName As String = "myusername"
Dim sUserPassword As String = "mypassword"
Dim sServerName As String = "MYServerName"
Dim sDBName As String = "MyDBName"
'you could also use a pad file here instead
'Now create a WebMethod to do something.... This particular one
'will return the UniqueID's of contacts whose table/field data match the specified string:
<System.Web.Services.WebMethod()> _
Public Function GetContactIDsByField(ByVal sTableName As String, ByVal sFieldName As String, ByVal criteria As String) As String()
Dim IDs As New ArrayList
'Log in to the framework...
ActFwk.LogOn(sActUserName, sUserPassword, sServerName, sDBName)
'Set up the lookup:
Dim oColumn1 As Act.Framework.Lookups.CriteriaColumnDim oOperator1 As Act.Framework.Lookups.OperatorEnum
Dim cLookup As Act.Framework.Lookups.ContactLookup
Dim cList As ContactListoOperator1 = Act.Framework.Lookups.OperatorEnum.EqualTo
oColumn1 = ActFwk.Lookups.GetCriteriaColumn(sTableName, sFieldName, True)
Dim lCriteria As Act.Framework.Lookups.Criteria() = New Act.Framework.Lookups.Criteria() _{New Act.Framework.Lookups.Criteria(Act.Framework.Lookups.LogicalOperator.End, CByte(0), CByte(0), _
oColumn1, oOperator1, criteria)} cLookup = ActFwk.Lookups.LookupContactsReplace(lCriteria, True, True)
'Do the lookup:
cList = cLookup.GetContacts(Nothing)
For Each myContact As Contact In cList
IDs.Add(New String(myContact.ID.ToString))
Next
Return IDs.ToArray(GetType(String))
End Function
End Class
Now that you have your webservice method, you can call it on your web page. Just feed the method a table, a field, and some criteria, and it will return the UniqueID(s) of the ACT Contact(s) that match.
09-04-2008 01:22 PM - edited 09-04-2008 01:30 PM
07-01-2014 01:03 PM
How about a local installation of Act?Is there any quide on how to connect a Web Service with a local installation of act?