Genivia Home Documentation
json.h File Reference

updated Wed Feb 8 2017
 
Functions
json.h File Reference
#include "soapH.h"
Include dependency graph for json.h:

Functions

int json_error (struct soap *soap, struct value *v)
 Set value to JSON error property given the context's error code, as per Google JSON Style Guide.
int json_write (struct soap *soap, const struct value *v)
 Write JSON value to the context's output (socket, stream, FILE, or string)
int json_send (struct soap *soap, const struct value *v)
 Send JSON value, requires soap_begin_send() before this call and soap_end_send() to finish, this function is used by json_write()
int json_read (struct soap *soap, struct value *v)
 Read JSON value from context's input (socket, stream, FILE, or string)
int json_recv (struct soap *soap, struct value *v)
 Receive JSON value, requires soap_begin_recv() before this call and soap_end_recv() to finish, this function is used by json_read()
int json_call (struct soap *soap, const char *endpoint, const struct value *in, struct value *out)
int json_send_string (struct soap *soap, const char *s)
 Convert string to JSON string and write it to context's output.

Function Documentation

int json_call ( struct soap *  soap,
const char *  endpoint,
const struct value in,
struct value out 
)
Client-side JSON REST call to endpoint URL with optional in and out values (POST with in/out, GET with out, PUT with in, DELETE without in/out), returns SOAP_OK or HTTP code
Parameters
soapcontext that manages IO
endpointURL of the JSON REST/RPC service
invalue to send, or NULL (when non-NULL: PUT or POST, when NULL: GET or DELETE)
outvalue to receive, or NULL (when non-NULL: GET or POST, when NULL: PUT or DELETE)
Returns
SOAP_OK or error code with out set to the JSON error property
int json_error ( struct soap *  soap,
struct value v 
)

Set value to JSON error property given the context's error code, as per Google JSON Style Guide.

Parameters
soapcontext with soap->error set
vvalue to set
Returns
error code
int json_read ( struct soap *  soap,
struct value v 
)

Read JSON value from context's input (socket, stream, FILE, or string)

Parameters
soapcontext that manages IO
vvalue to read (non NULL)
Returns
SOAP_OK or error code
int json_recv ( struct soap *  soap,
struct value v 
)

Receive JSON value, requires soap_begin_recv() before this call and soap_end_recv() to finish, this function is used by json_read()

Parameters
soapcontext that manages IO
vvalue to receive (non NULL)
Returns
SOAP_OK or error code
int json_send ( struct soap *  soap,
const struct value v 
)

Send JSON value, requires soap_begin_send() before this call and soap_end_send() to finish, this function is used by json_write()

Parameters
soapcontext that manages IO
vvalue to send
Returns
SOAP_OK or error code
int json_send_string ( struct soap *  soap,
const char *  s 
)

Convert string to JSON string and write it to context's output.

Parameters
soapcontext that manages IO
sstring to send
Returns
SOAP_OK or error code
int json_write ( struct soap *  soap,
const struct value v 
)

Write JSON value to the context's output (socket, stream, FILE, or string)

Parameters
soapcontext that manages IO
vvalue to write
Returns
SOAP_OK or error code