Community
Showing results for 
Search instead for 
Do you mean 
Reply

Web Services

New Member
Posts: 1
Country: Australia

Web Services

Is there any documentation someone could point me to on how to use / consume the ACT framework as a web service? I'm trying to get access to it via adobe air/flex but not sure how to get the framework functions
New Member
Posts: 8
Country: USA

Re: Web Services

[ Edited ]

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.CriteriaColumn

  Dim oOperator1 As Act.Framework.Lookups.OperatorEnum

  Dim cLookup As Act.Framework.Lookups.ContactLookup  

  Dim cList As ContactList

  oOperator1 = 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.

 

Message Edited by cameronb on 09-04-2008 01:35 PM
Message Edited by cameronb on 09-05-2008 12:51 PM
New Member
Posts: 8
Country: USA

Re: Web Services

[ Edited ]
Oh, and the webservice has to run on the ACT server. There's probably a way around that though. Feel free to email me if you have any questions.... cameron@peggyhoag.com
Message Edited by cameronb on 09-04-2008 01:30 PM
gkl
Copper Contributor
Posts: 29
Country: Ecuador

Re: Web Services

How about a local installation of Act?Is there any quide on how to connect a Web Service with a local installation of act?