NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Thys on September 01, 2017, 04:54:28 AM

Title: NetWebServiceMethod - how to return complex structure
Post by: Thys on September 01, 2017, 04:54:28 AM
Hi,

I would like a method to return a combination of records that when combined serve a business purpose. It's like returning the content of a Clarion view in the response. The only indication in the documentation is to have two or more queue output parameters, which doesn't make it easy for the client app to consume. The documentation goes further to explain that it may be possible to have queue pointers within a queue - but that the explanation of how to do this might be too complex to understand, given that you need to use NEW and DISPOSE to manage memory. But I went the full way in doing this, but the response doesn't show the objects related to the queue pointers, only values. So this method doesn't seem to work although the documentation alludes to that it may be possible.

Is there any other way to have a complex response objects in a method, other than "flattening" it out to multiple output parameters?

Thys
Title: Re: NetWebServiceMethod - how to return complex structure
Post by: Bruce on September 01, 2017, 08:41:59 AM
Hi Thys,

I know I'm behind on examples at the moment, but generating complex data (as per the xFiles / jFiles docs) is working here. So Perhaps the best step to debugging is if you post an example of what you are doing and I can check it for you.

cheers
Bruce

Title: Re: NetWebServiceMethod - how to return complex structure
Post by: Thys on October 04, 2017, 01:09:39 AM
Hi Bruce.

Attached is a small example app that shows the sub-queue values displayed as numbers. Please tell me what I'm doing wrong.

Thanks
Thys
Title: Re: NetWebServiceMethod - how to return complex structure
Post by: Thys on October 04, 2017, 11:56:32 PM
Hi Bruce.

I worked through the Demo app in the jFiles example folder. I found that one of the tests read "if pName.GetValue() = 'Apaid'" and I think it must be "if pName.GetValue() = 'paid'". Then where the LineItems are added, the resultant JSON doesn't give the customary [ ] on the boundaries, but rather { }.

I still have to rework my example app in this thread. In the Demo app, the sub-sections are retrieved using a Clarion VIEW. In my example it's a Clarion QUEUE and I get different results from the VIEW. Still working on it...

Thys