NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: David on December 03, 2018, 11:20:37 AM
-
NT11.04, Clarion 11
After reading the docs :-) I added a Sync procedure, using the Wizard, and then tried adding a SyncAccounts procedure using ServerWebServiceMethodWizard. The generated code for CheckForToken is missing information. I went through the wizard a few times to make sure I wasn't missing anything and then went trough the "Actions" tab to see if anything obvious was missing. Below is the generated code. You can see that the ExistsValue('') and GetValue('') are missing information. There is a line where the left side of the = is missing. Is there something I need to add to a setting or is this a bug?
CheckForToken routine
! Start of "Start of CheckForToken Routine"
! [Priority 5000]
! End of "Start of CheckForToken Routine"
! before getting started check to see if there is a token for the session ID
If p_web.xml = 0 and p_web.json = 0 ! incoming parameters are just url encoded, either in the URL, or as post data, or as a cookie.
If p_web.IfExistsValue('') then = p_web.GetValue('').
ElsIf p_web.xml = 1
Clear()
= strxml.between(p_web.Nocolon(lower('<token>'),Net:SingleUnderscore+Net:NoSpaces),p_web.Nocolon(lower('</token>'),Net:SingleUnderscore+Net:NoSpaces))
ElsIf p_web.json = 1
json.Start()
json.RemovePrefix = false ! token field won't be in a structure, so no concept of prefix, so no need to remove it.
json.ReplaceColons = true
json.ReplacementChars = '_'
strjson.SetValue(p_web.GetValue('_json_'))
json.SetTagCase(jf:CaseLower)
if json.LoadString(strjson) = jf:ok
Clear()
= json.GetPropertyValue('token',1)
Else ! jf:error
p_web.AddServiceError(Error:InvalidJson,'SyncAccounts', '', json.error,'Review JSON data and correct it.')
End
End
if
p_web.SessionID =
p_web.TouchSession()
end
-
Bruce, any suggestions on where to look?
-
I've seen the IDE do this when importing the TXA (which the wizard creates).
Re-importing the TXA manually can often sort it out.
It seems that the Parameters are added to the procedure, but not "attached" to the actual local variables.
Trivial to do that manually of course (just open the parameter and set the Field value).
It seems like an IDE-importing-TXA type bug though because the -reimport of the TXA seems to work.
cheers
Bruce
-
Thank you. Once I linked the Parameters to the local variables everything compiled.