The forum will be unavailable for maintenance at some point from Friday, April 13 at 19:00 EDT until Sunday, April 15 at 23:59 EDT. Downtime will be minimized but the exact timing is unknown.

Hi All,

Is google-form, the user fills in the fields on it and presses the button, which is formed by the json object, and call my web service in SA 12.0.1 which that the json-object should be transferred.

This JS-method code that calls the service at Sybase SA 12.0.1

function postToURL_1(formObject, URL) {
  var result = {};
  try {
    var options =
        { "method": "post",
         "contentType": "application/json",
         "muteHttpExceptions": true,
         "payload": JSON.stringify([ formObject.text, +formObject.number,
formObject.string, formObject.inputDate, formObject.myFile ])
    result.status = true;
    result.message = 'Запрос выполнился';
    var response = UrlFetchApp.fetch(URL, options);
    result.itog = JSON.parse(response);
  catch (err) {
    result.status = false;
    result.message = 'Запрос не выполнился';
    result.err = err;
  return result;

The URL parameter is passed a reference to the web-service formObject is google-form.

This is the code from the database:


CREATE PROCEDURE "DBA"."WebTest1"(in cXML long varchar)
RESULT( cReturn long varchar ) 
 select cXML;

The parameter should come cXML json-object, but why it does not come. That is, the web-service call and subsequent call dba.WebTest1 happening, but why it cXML null value (NULL) comes.

asked 03 Mar '17, 09:28

Stalker's gravatar image

accept rate: 0%

In the Help you can read that the Parameters to a service can be Host Variables.

Create Service -> statement

Specifies a command, such as a stored procedure call, to invoke when the service is accessed.
In a typical web service application, you use statement to call a function or procedure. You can pass host variables as parameters to access client-supplied HTTP variables.

You should use the HTTP_BODY function to get the POST Data.


permanent link

answered 03 Mar '17, 09:48

Thomas%20Duemesnil's gravatar image

Thomas Dueme...
accept rate: 17%

edited 06 Mar '17, 03:56

Many thanks for the tip, HTTP_BODY() returns the value of transmitted json-object. But still not clear why the cXML comes NULL ?

(03 Mar '17, 13:29) Stalker
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 03 Mar '17, 09:28

question was seen: 522 times

last updated: 06 Mar '17, 03:56