NetTalk Central

Author Topic: NetWebServerWorker  (Read 4677 times)

Sibuya

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
    • Email
NetWebServerWorker
« on: March 28, 2016, 04:34:24 PM »
Hi,

Sorry for my ignorance, I'm new in NT. But I would like to know where I find documentation about NetWebServerWorker.

I would like to know for example what is the difference between SetSessionValue and SSV and some other methods like Script and so on.

Thank you.

Cheers,

Marcos

urayoan

  • Full Member
  • ***
  • Posts: 222
    • View Profile
    • AZ Rock Radio
Re: NetWebServerWorker
« Reply #1 on: March 29, 2016, 05:20:46 AM »
Hi Sibuya, my recommendation is to get the book from Bruce from this link. Is worth every penny!

http://capesoft.com/books/nettalk/home.htm

About SSV, is the short version of SetSesionValue (does the same)

p_web.SSV('loc:SomeValue','Some Value') or equivalent p_web.SetSsessionValue('loc:SomeValue','Some Value')

To get the value assigned to the session you use this

p_web.GSV('loc:SomeValue') or p_web.GetsessionValue('loc:SomeValue')

Another place you can get help is the Weekly webinars and the past webinars from Bruce. Very useful and a lot of examples using NetTalk for web servers

Cheers
« Last Edit: March 29, 2016, 11:35:51 PM by Bruce »

Sibuya

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
    • Email
Re: NetWebServerWorker
« Reply #2 on: March 29, 2016, 10:19:17 AM »
Hi Urayoan,

The book enlighted me a lot but I still have some difficulties.

For example. I can see in WebServer log a GET message with SetSessionValue an a Value (string in Base64 correct form) followed by a POST with this value with all "+" replaced by spaces. So when trying to get this value with GetValue() I got with these spaces in Base64 string. Is that correct?

Thank you.

Cheers,

Marcos


Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: NetWebServerWorker
« Reply #3 on: March 29, 2016, 11:37:58 PM »
Hi Marcos,

>> So when trying to get this value with GetValue() I got with these spaces in Base64 string. Is that correct?

I think you need to post screen-shots or something of what you are seeing. Or better yet come to one of the user group webinars.
It's hard to comment on what you are seeing without seeing it.

http://www.capesoft.com/accessories/NetTalkUserGroup.htm

cheers
Bruce

robirenz

  • Jr. Member
  • **
  • Posts: 88
    • View Profile
    • Email
Re: NetWebServerWorker
« Reply #4 on: March 30, 2016, 07:13:54 AM »
I seems that nettalk urldecodes all incoming gets when you do the getvalue requests.

NetWebServerWorkerBase.GetValueFormat

        of net:IsNumber
          returnvalue = self.DformatNumber(self._LocalDataQueue.Value,self._LocalDataQueue.Picture)
          !str.KeepChars('01234567890.-')
          !returnvalue = str.GetValue()
        of net:IsTyped  ! space up, plus 13,10
          str.RemoveChars('<0,1,2,3,4,5,6,7,8,9,11,12,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31>')
          returnvalue = str.GetValue()
        of net:OnlySpaceup   ! only keeps chars 32 and up.
          str.RemoveChars('<0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31>')
          returnvalue = str.GetValue()


so if the text is only not urlencoded and only has pure base 64 it truncates some characters..

you'll need to get the value some other way that is not the getvalue method or Bruce needs to gives us a raw way to get the value.
there might already be a way, I just don't know it.

Best Regards...

Roberto Renz

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: NetWebServerWorker
« Reply #5 on: March 30, 2016, 11:50:32 PM »
Hi Roberto,

There are standards regarding how URLs work, and how the data on the URL is encoded.
So, if you post an "incorrect" URL on the sending side, you naturally get an inaccurate result of the receiving side.

I recommend you use the StringTheory method, URLEncode, to encode the parameters correctly when constructing the URL on the sending side.
http://www.capesoft.com/docs/StringTheory/StringTheory.htm#stUrlEncode

cheers
Bruce