json.JSONWriter.writeTo

Sets the output stream of the JSONWriter object to a file or an URL, and starts streaming data.

Syntax

writeTo(
   url STRING )
  1. url defines a valid URL or the name of the file that will contain the resulting JSON document.

Usage

This method sets the output stream of the JSONWriter object to a file or a URL specified in name, and starts the streaming.

Only the following kinds of URLs are supported:
  • http://
  • https://
  • tcp://
  • tcps://
  • file:///
  • alias://
See fglprofile Configuration for more details about URL mapping with aliases, and for proxy and security configuration.

In case of error, the method throws an exception and sets the status variable. Depending on the error, a human-readable description of the problem is available in the sqlca.sqlerrm register. See Error handling in GWS calls (status).

Examples

writeTo("printerList.json")
writeTo("http://myserver:1100/documents/printerList.json")
writeTo("https://myserver:1100/documents/printerList.json")
writeTo("alias://printerlist")
In the example printerlist alias is defined in fglprofile as ws.printerlist.url = "http://myserver:1100/documents/printerList.json".