RegisterInterface - cWebService

Registers a message (property, function, procedure) and make it available as a Call message within an ASP page

Type: Procedure

Parameters: Integer iMsg String sMsgName String sParams String sComment

ParameterDescription
iMsgid of message to register, usually message name preceded by "get_" (function) or "msg_" (procedure)
sMsgNamename of the message, in quotes, usually message name preceded by "get_" (function) or "msg_" (procedure)
sParamsarguments to the message, preceded by each argument's type; should be the same as message declaration
sCommentmessage description; brief summary of what message does


Syntax
Procedure RegisterInterface Integer iMsg String sMsgName String sParams String sComment

Call: Send RegisterInterface iMsg sMsgName sParams sComment


Description

Rather than manually writing code for this, registering, or "publishing" a method, is typically done in the DataFlex Studio. You can select a method in Code Explorer and publish or unpublish it there. See Code Explorer for more information.


The RegisterInterface message is used to register a message (property, function, procedure) and make it available as a Call message within an ASP page.

Four parameters are required:

iMsgNumber


This is the message number. Normally this is passed as the message name preceded by get_ (for functions and retrieving properties), set_ (for setting properties) or msg_ (for procedures). For example:

get_SomeProperty or get_SomeFuntion
set_SomeProperty
msg_SomeProcedure


sMsgName


This is the name of the message that will be used in the ASP page. Normally you should make this the same name as the property (just put quotes around the property name).

"get_SomeProperty" or "get_SomeFunction"
"set_SomeProperty"
"msg_SomeProcedure"


sParams


This records the list of parameters used by the message. This is not required and is used for documentation purposes.

sComment


This records a description of the message. This is not required and is used for documentation purposes.

All Call messages must be registered before they can be used (unless you set the UseOpenEvalInterface_state property to true). For example, if you wanted to expose the get_FindByRecId message you would register it as follows:

Object SalesP_WBO is a WebBusinessProcess
    Object Salesp_DD is a Salesp_DataDictionary
        Send DefineAllExtendedFields
    End_Object  // Salesp_DD
    Set phMainDD to (Salesp_DD(Self))
    Send RegisterInterface get_DoRequestFindbyRecId ;
        "get_DoRequestFindbyRecId" "sFile iRecord" ;
        "Find by recnum for the passed file and record"
End_Object  // SalesP_WBO


Instead of needing to create a RegisterInterface message for each message you plan to register some messages have been combined into interface procedures allowing you to register a single set of interfaces at one time. Those predefined interface messages are:

Send RegisterStandardInterface
Send RegisterBasicErrorInterface
Send RegisterFullErrorInterface
Send RegisterDebugInterface
Send RegisterAutoEntryInterface

Typically, you will want to register the standard interface.

Object SalesP_WBO is a WebBusinessProcess
    Object Salesp_DD is a Salesp_DataDictionary
        Send DefineAllExtendedFields
    End_Object  // Salesp_DD
    Set phMainDD to (Salesp_DD(Self))
    Send RegisterStandardInterface
End_Object  // SalesP_WBO


If the same message is registered more than once, only the first registration is applied.

DataFlex Code

Send RegisterInterface get_DoRequestFindbyRecId ;
    "get_DoRequestFindbyRecId" "sFile iRecord" ;
    "Find by RecId (recnum) for the passed file and record"


Note

This message has changed from WebApp revision 2.x. If you do not change the format of your message from the old format, you will get errors when run your application and these messages are sent.

The old format looked like this:

Send RegisterInterface msg_SetHRefName "msg_SetHRefName" "sName" "Name to link for drill down report"
Send RegisterInterface get_RunCustomerReport "get_RunCustomerReport" "iIndex iStart iMax" "Run report"

The new format looks like this:

Send RegisterInterface msg_SetHRefName "msg_SetHRefName" "String sName" "Name to link for drill down report"
Send RegisterInterface get_RunCustomerReport "get_RunCustomerReport" "Integer iIndex Integer iStart Integer iMax Returns integer" "Run report"