Tamino Server Extensions using ActiveX Exe and Dll

I need some help in creating server extensions in Tamino. I wrote a small VB ActiveX Exe program to see how server extenstions work. The purpose of the small VB function is to remove all spaces in an input string and return the result as a string.

Everything I did was based on the SAG Tamino 3.1.1.1 documentation for creating SE’s using VB.

I analyzed the VB .exe program as explained in the help, created the Tamino package using Tamino Analyzer and installed the server extension to our dummy database. Everything done according to the book. If I look at it(the extension) in Tamino Management Hub I can see the function and I can see the info about the function.

Now the problem - using it !!!.

This is what I enter in my browser http://MyWebServer/tamino/mydb/myCollection?_xql=SXSufrS.RemoveSpaces(‘a b c d e f’)

And this is the response I get from Tamino.

<?xml version="1.0" encoding="iso-8859-1" ?>
- <ino:response xmlns:ino=“http://namespaces.softwareag.com/tamino/response2” xmlns:xql=“XQL FAQ (XML Query Language - Frequently Asked Questions)”>
xql:querySXSufrS.RemoveSpaces(‘a b c d e f’)</xql:query>
- <ino:message ino:returnvalue=“8366”>
<ino:messagetext ino:code=“INOXIE8366”>Wrong arguments for function</ino:messagetext>
</ino:message>
</ino:response>

Following the VB sample code. (VB class)

---------- Start of Code ----------
Option Explicit
Public Function RemoveSpaces(ByVal InputStr As String) As String
Dim TmpStr As String
Dim Rev As String
Dim Llen As Long
Dim I As Long
'
On Error GoTo SpaceError
Rev = “”
'
TmpStr = Trim(InputStr)
Llen = Len(TmpStr)
If Llen = 0 Then
Err.Raise 9000, “SXufrS.RemoveSpaces”, “Error: No Input Value was provided”
RemoveSpaces = “”
Exit Function
End If
'
For I = 1 To Llen
If Mid(TmpStr, I, 1) <> Chr(32) Then
Rev = Rev + Mid(TmpStr, I, 1)
End If
Next
RemoveSpaces = Trim(Rev)
Exit Function
'
SpaceError:
RemoveSpaces = “An error occured”
Exit Function
End Function
----------- End of Code -----------
I have this reference in my VB program to this Tamino Dll. I am not using Callbacks - yet :slight_smile:
Reference in VB project to: Program Files\Software AG\Tamino\Tamino 3.1.1.1\Bin\sxrte.dll #Tamino SXS 2.3 Runtime Library

No matter what I do, using an input parameter or not, using (ByVal InputStr As String) or (ByRef InputStr As String) or (InputStr As String) I keep getting the same error. I even compiled the function into a ActiveX Dll instead of the recommended ActiceX EXE. Same error.

Can you please tell me what I am doing wrong ?

Thank you
Naas du Plessis

The problem is most probably not Your code but the way You declared the parameters. If you chose “XML-OBJ” as return value of Your function, the result has to be an ordinary XML document; try “char-str” instead.
Could You please provide the file install.xml (can be found in the directory …Tamino/Server Extension// ) by mail ?
Regards, Michael