Web Connection
wwDotNetBridge initilization
Gravatar is a globally recognized avatar based on your email address. wwDotNetBridge initilization
  Harvey Mushman
  All
  Jul 21, 2014 @ 09:30am
With a Callback, I want to POST a JSON object back to myServer. On the server do something like the following:

lcJson = Request.cFormVars

if left(lcJson)='&'
lcJson=SUBSTR(lcJson,2)
endif

loSer = CREATEOBJECT("wwJsonSerializer")
lvData = loSer.DeserializeJson(lcJson)

I get an error message that basically says... the wwDotNetBridge does not exist!

After a lot of reading and not seeing anything in specific, I figure it is time to ask the question. Where should the following line be most correctly added for an application that will be calling on the DotNetBridge from many Callback functions?

do DotNetBridge

myAppMain.prg :: OnLoad() or from myProcess_subclass or myPage :: OnLoad() ? So many options where it will work...

Then again... maybe I should hack wconnect.prg and add it there...

Any suggestions?

Gravatar is a globally recognized avatar based on your email address. Re: wwDotNetBridge initilization
  Rick Strahl
  Harvey Mushman
  Jul 21, 2014 @ 01:49pm

It's wwDotnetBridge.prg that you need to call.

Files should be there for Web Connection 5.5 and later.

You do need .NET 2 or 4+ installed in order for the .NET portion (DeserializeJson) to work.

+++ Rick ---



With a Callback, I want to POST a JSON object back to myServer. On the server do something like the following:

lcJson = Request.cFormVars

if left(lcJson)='&'
lcJson=SUBSTR(lcJson,2)
endif

loSer = CREATEOBJECT("wwJsonSerializer")
lvData = loSer.DeserializeJson(lcJson)

I get an error message that basically says... the wwDotNetBridge does not exist!

After a lot of reading and not seeing anything in specific, I figure it is time to ask the question. Where should the following line be most correctly added for an application that will be calling on the DotNetBridge from many Callback functions?

do DotNetBridge

myAppMain.prg :: OnLoad() or from myProcess_subclass or myPage :: OnLoad() ? So many options where it will work...

Then again... maybe I should hack wconnect.prg and add it there...

Any suggestions?




Rick Strahl
West Wind Technologies

Making waves on the Web
from Maui

Gravatar is a globally recognized avatar based on your email address. Re: wwDotNetBridge initilization
  Harvey Mushman
  Rick Strahl
  Jul 21, 2014 @ 02:58pm
Yea, I discovered all of this on my own but my questions is where to call on it so it only has to load the fewest time but will be available the WV framework needs it to be? In the Server or Process or _page.prg?

...where Server is myAppMain.prg and Process is a subclass of wwProcess.

--hm

It's wwDotnetBridge.prg that you need to call.

Files should be there for Web Connection 5.5 and later.

You do need .NET 2 or 4+ installed in order for the .NET portion (DeserializeJson) to work.

+++ Rick ---



With a Callback, I want to POST a JSON object back to myServer. On the server do something like the following:

lcJson = Request.cFormVars

if left(lcJson)='&'
lcJson=SUBSTR(lcJson,2)
endif

loSer = CREATEOBJECT("wwJsonSerializer")
lvData = loSer.DeserializeJson(lcJson)

I get an error message that basically says... the wwDotNetBridge does not exist!

After a lot of reading and not seeing anything in specific, I figure it is time to ask the question. Where should the following line be most correctly added for an application that will be calling on the DotNetBridge from many Callback functions?

do DotNetBridge

myAppMain.prg :: OnLoad() or from myProcess_subclass or myPage :: OnLoad() ? So many options where it will work...

Then again... maybe I should hack wconnect.prg and add it there...

Any suggestions?





--hm--

Gravatar is a globally recognized avatar based on your email address. Re: wwDotNetBridge initilization
  Rick Strahl
  Harvey Mushman
  Jul 21, 2014 @ 03:08pm

DO wwDotnetBridge.prg

should go into the Server OnLoad() method along with all the other SET PROCEDURE/SET CLASSLIB registrations. That way it'll be globally available and only run once.

I also recommend that you do:

DO wwDotnetBridge.prg
GetwwDotnetBridge("V4") && or V2

to force loading of the framework you want to use explicitly. First load determines the framework version that is used for all subsequent calls. Also recommend you always use GetwwDotnetBridge() to get instances of the object as this will reuse the same cached instance internally.

+++ Rick ---



Yea, I discovered all of this on my own but my questions is where to call on it so it only has to load the fewest time but will be available the WV framework needs it to be? In the Server or Process or _page.prg?

...where Server is myAppMain.prg and Process is a subclass of wwProcess.

--hm

It's wwDotnetBridge.prg that you need to call.

Files should be there for Web Connection 5.5 and later.

You do need .NET 2 or 4+ installed in order for the .NET portion (DeserializeJson) to work.

+++ Rick ---



With a Callback, I want to POST a JSON object back to myServer. On the server do something like the following:

lcJson = Request.cFormVars

if left(lcJson)='&'
lcJson=SUBSTR(lcJson,2)
endif

loSer = CREATEOBJECT("wwJsonSerializer")
lvData = loSer.DeserializeJson(lcJson)

I get an error message that basically says... the wwDotNetBridge does not exist!

After a lot of reading and not seeing anything in specific, I figure it is time to ask the question. Where should the following line be most correctly added for an application that will be calling on the DotNetBridge from many Callback functions?

do DotNetBridge

myAppMain.prg :: OnLoad() or from myProcess_subclass or myPage :: OnLoad() ? So many options where it will work...

Then again... maybe I should hack wconnect.prg and add it there...

Any suggestions?







Rick Strahl
West Wind Technologies

Making waves on the Web
from Maui

© 1996-2024