Hi,
is it possible to publish an own JSON API with the .net Web Service? I am quite lost regarding the request and responses, cause the asmx documentation only show xml.
I only find documentations on how to consume an json api.
Thank you
Timo
JSON webservice.dll
JSON webservice.dll
Timo Witte
BPCS Consulting Services
BPCS Consulting Services
Re: JSON webservice.dll
Hi Timo,
it is possible that a webservice written with Gupta also responds to a REST-like - Call.
In the build settings you have to check "Enable JSON" just right to NET Target Type "NET Web Service (dll)".
If you do so the service responds either SOAP or JSON.
But the JSON-Format which is returned is a bit crude - it looks like so for example:
The original UDV was one with instance variables like
Especially the DateTime and Number types look "strange".
I was not able to put that directly in same Gupta UDV with SalDeserializeJson.
I think the only way to cope with the JSON is to craft a second UDV with the returned schema and then do the conversion of the date-format myself.
Hope this helps a litte bit.
Regards Thomas
it is possible that a webservice written with Gupta also responds to a REST-like - Call.
In the build settings you have to check "Enable JSON" just right to NET Target Type "NET Web Service (dll)".
If you do so the service responds either SOAP or JSON.
But the JSON-Format which is returned is a bit crude - it looks like so for example:
Code: Select all
{
"d": {
"__type": "YourModuleName.UpdateDate",
"dtUpdate": {
"__type": "Gupta.TD.Runtime.SalSystem.SalDate",
"IsYearZero": false,
"Value": "/Date(1671901200000)/",
"IsNull": false
},
"sNextVersion": "X2208",
"bValid": true,
"nDurationInMinutes": {
"__type": "Gupta.TD.Runtime.SalSystem.SalDecimal",
"Value": 180,
"IsNull": false
}
}
}
Code: Select all
Date/Time: dtUpdate
String: sNextVersion
Boolean: bValid
Number: nDurationInMinutes
I was not able to put that directly in same Gupta UDV with SalDeserializeJson.
I think the only way to cope with the JSON is to craft a second UDV with the returned schema and then do the conversion of the date-format myself.
Hope this helps a litte bit.
Regards Thomas
Re: JSON webservice.dll
Hi Thomas,
thank you for your input. Currently we are sending json within the xml and use it as container for it. It's not optimal, but at least it works. The solution is OpenText / Gupta "like". I really don't get why they always have to reinvent the wheel.
Cheers
Timo
thank you for your input. Currently we are sending json within the xml and use it as container for it. It's not optimal, but at least it works. The solution is OpenText / Gupta "like". I really don't get why they always have to reinvent the wheel.
Cheers
Timo
Timo Witte
BPCS Consulting Services
BPCS Consulting Services
Who is online
Users browsing this forum: [Ccbot] and 1 guest