JSON webservice.dll

Discussion forum about all things Gupta, OpenText and the community.
TWitte
Germany
Posts: 74
Joined: 06 Nov 2017, 13:07
Location: Unterhaching

JSON webservice.dll

Post by TWitte » 08 Nov 2022, 10:10

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
Timo Witte
BPCS Consulting Services

thomas.uttendorfer
Site Admin
Site Admin
Germany
Posts: 304
Joined: 05 Mar 2017, 17:19
Location: Munich Germany

Re: JSON webservice.dll

Post by thomas.uttendorfer » 08 Dec 2022, 16:24

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:

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
		}
	}
}
The original UDV was one with instance variables like

Code: Select all

Date/Time: dtUpdate
String: sNextVersion
Boolean: bValid
Number: nDurationInMinutes
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
Thomas Uttendorfer
[ frevel & fey ] Software-System GmbH
https://thomasuttendorfer.wordpress.com/

TWitte
Germany
Posts: 74
Joined: 06 Nov 2017, 13:07
Location: Unterhaching

Re: JSON webservice.dll

Post by TWitte » 09 Dec 2022, 07:44

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
Timo Witte
BPCS Consulting Services

Return to “General Discussion”

Who is online

Users browsing this forum: [Ccbot] and 1 guest