Welcome! Log In Create A New Profile

Advanced

Generic HAdd function in web service

Posted by Prolay Sarkar 
Prolay Sarkar
Generic HAdd function in web service
February 01, 2009 10:08AM
Hi,

I am trying to make a generic "add to table" function wherein i specify the Analysis file name and the buffer and it will do the save operation. This is what i was trying..

Client Side
--------------
ScreenToFile()
cd is CTABLE_DW
FileToMemory(cd,TABLE_DW)
s is buffer
Serialize(cd,s,psdXML)
WriteIO("TABLE_DW",s) //Name of the function on the server side

Web Service (server)
----------------------------
PROCEDURE WriteIO(FileName,ObjString)

strCompile is string= [
obj is "C%1"
Deserilaize(obj, %2, psdXML) //error on this line
MemoryToFile(obj, %1)
IF NOT Hadd("%1") Then
RESULT "Error"
ELSE
RESULT "True"
END
]
strCompile=StringBuild(strCompile,FileName,"ObjString")

sResult is string
sCompileResult is string
sCompileResult = Compile("Dynamic_Proc", strCompile)
tstr=ObjString
SWITCH sCompileResult
CASE "": sResult = ExecuteProcess("Dynamic_Proc", trtProcedure)
CASE "ERR": sResult = "Unable to compile. "+CR+ErrorInfo()
CASE sResult = sCompileResult
END

------------------------------------------------------
This code is not working . First of all i want to decide that what should be the class name from the file name received. I tried

obj is "C"+ FileName

I have tried making "ObjString" as a global variable.

but this is not possible. What do you have to say about it and what can be possible solution if i want to make a generic HAdd.


Regards
Prolay
DerekT
Re: Generic HAdd function in web service
February 01, 2009 03:06PM
Prolay

Check out Indirection in the Help

Regards

DerekT
Prolay Sarkar
Re: Generic HAdd function in web service
February 01, 2009 04:14PM
Hi Derek,

Can you provide with an example code if you have one.

Regards,
Prolay

DerekT
Re: Generic HAdd function in web service
February 01, 2009 04:52PM
Prolay

Not sure if this applies to your code but a genric statement would be

IF NOT Hadd({Filename,indFile}) THEN //If Filename is a param received

Regards

DerekT
Prolay Sarkar
Re: Generic HAdd function in web service
February 01, 2009 05:02PM
Hi Derek

Thanks a lot. It is now working But will the Htransaction apply on the dynamic compilation. I have native drivers and using MS-SQL


Regards
Prolay

DerekT
Re: Generic HAdd function in web service
February 01, 2009 05:17PM
Prolay

Assuming it worked before then, Yes.

Indirection is a method of converting string/varialbles/controls into a value that WD reconizes.

Regards

DerekT
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: