Gordian Gossen - 2002-07-05

Hello Keyton,

I have some trouble to call my own "input-processor-script".
Perhaps you can show me the way:

-------------------------------------------------
Fact 1
-------------------------------------------------
I added the following function in

----- extension.py --------
def getZippedXML(tokenDictionary, paramDictionary,c,d):
  unzippedContent = myUtil.getMessageContent ("unzipped.xml")
  zippedContent   = myUtil.compressBufferWithGZIP (unzippedContent)
  return zippedContent
----- extension.py --------

It reads the content of a XML-file and put it into a string.
This string will be zipped and returned as string.

(REMARK: the parameter 'c' and 'd' are dummies, because without them, i got an error message:
...TypeError: getZippedXML() takes exactly 2 arguments (4 given)...

(please look at the end of this mail for the whole stacktrace - but this is not the main problem)
-------------------------------------------------

-------------------------------------------------
Fact 2
-------------------------------------------------

I don't know exactly how to call this processor-script in the puffinConfig.xml.

!! I must send the zipped XML string in the body of an POST Request!!

I tried and read your userguide, but i didn't understand.

? Does data in a POST request must always be in a key/value pair?
? What text should the  <param> name??? </param> Tag contain ?
? Do i need a <param> tag?

One example i tried:
--------- puffin.xml ---------
...
<testAction name='login'>
  <path>/servlet/DocLogonServlet</path>

  <input name="whatName"
         type="POST"
         processor="getLoginXML"
         src="CUSTOM">

   <param name='myParam' eval='0'>zippedContent</param>

  </input>
</testAction>
....
--------- puffin.xml ---------

----------------------------------------------
I get the following error message:
...
2002-07-05 19:41:24,820 puffin An error occurred in processing the input 'whatName'. None will be returned for its value
...

----------------------------------------------

Would you please tell me how it works?

Thank you for your time and have a good day.

MFG
Gordian Gossen

##################################
(REMARK: the parameter 'c' and 'd' are dummies, because without them, i get an error message (please look at the end of this mail)
######################################################

Traceback (most recent call last):
  File "testaction.py", line 231, in execute
    httpGETInputs, httpPOSTInputs, httpHeaderParamTupleList = self.__processInputs(tokenDictionary, taskItemInputs, inpu
tTokensTupleList)
  File "testaction.py", line 387, in __processInputs
    value = input.getInputValue(tokenDictionary=currentTokenDictionary)
  File "testtoken.py", line 227, in getInputValue
    inputValue = eval(execString + '(tokenDictionary, self.paramDictionary, self.defaultValue, None)')
  File "<string>", line 0, in ?
TypeError: getZippedXML() takes exactly 2 arguments (4 given)

###################################################
I monitored the values and there are 4 arguments, indeed!
( look at last line )

------------------------------
## inserted print statements in
in file:      testtoken.py
in function:  def getInputValue(self, tokenDictionary):
at line:      221
---------------------------------
OUTPUT:
-------

testtoken.py---execString---> extensions.getLoginXML

testtoken.py---tokenDictionary---> <testtoken.TokenDictionary instance at 00AAB78C>

testtoken.py---self.paramDictionary---> <paramdictionary.ParamDictionary instance at 00BDC5CC>

testtoken.py---self.defaultValue--->

testtoken.py---eval-parameter---> extensions.getLoginXML(tokenDictionary, self.paramDictionary, self.defaultValue,
None)