Web Connection
Object SERIALIZER is not found.
Gravatar is a globally recognized avatar based on your email address. Object SERIALIZER is not found.
  Josh
  All
  Nov 22, 2022 @ 06:31am

Generated a new process class to be able to accept and generate JSON files. Got it working on development machine but not on production machine. When using Rick's testpage code:

*** they are automatically serialized to JSON
loObject = CREATEOBJECT("EMPTY")
ADDPROPERTY(loObject,"name","TestPage")
ADDPROPERTY(loObject,"description",;
            "This is a JSON API method that returns an object.")
ADDPROPERTY(loObject,"entered",DATETIME())

*** To get proper case you have to override property names
*** otherwise all properties are serialized as lower case in JSON
Serializer.PropertyNameOverrides = "Name,Description,Entered"

I get the following error: Object Serializer is not Found Error number 1923 Current Code line 126

Is it the dot net Version?

Josh

Gravatar is a globally recognized avatar based on your email address. re: Object SERIALIZER is not found.
  Rick Strahl
  Josh
  Nov 23, 2022 @ 12:42pm

Where are you calling this code from?

The Serializer and JsonService variables are available only in the scope of a process method in a wwRestProcess class. They are not available outside of them (ie. in OnProcessInit() OnProcessComplete()) because they don't actually exists outside of that context.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Object SERIALIZER is not found.
  Josh Klein
  Rick Strahl
  Nov 23, 2022 @ 02:18pm

That was it. It was using the WWC_PROCESS class. I changed it to WWC_RESTPROCESS and it worked. I did generate the class using the CONSOLE app and thought I chose a REST process. In any case, thanks for your help.

Josh

© 1996-2024