Returning Parent-Child related data from a web service

pinne65

Member
How do you create a web service that returns parent-child joined database records : Customer->Order, Order->LineItems, or Customer->Order->Lineitems?

I.e. what would the ABL code look like that I would feed to proxygen?

It seemed like a DATASET would solve this but I'm getting an error when I run proxygen:

The parameter/return type DATASET is not supported from a web services client. It is currently only supported from a .NET or Java open client. (11108).

My test code below:

DEFINE TEMP-TABLE tmp-Order NO-UNDO LIKE Order.
DEFINE TEMP-TABLE tmp-OrderLine NO-UNDO LIKE OrderLine.
DEFINE DATASET dsOrderLineItem FOR tmp-Order, tmp-OrderLine
DATA-RELATION orderLineRel FOR tmp-Order, tmp-OrderLine
RELATION-FIELDS (oe-tran-num, oe-tran-num) NESTED.

DEFINE INPUT PARAMETER orderId LIKE Order.orderId NO-UNDO.
DEFINE OUTPUT PARAMETER DATASET FOR dsOrderLineItem APPEND.


I'm running currently OE 10.1C, waiting to move to 10.2A soon. Does anyone know if it will support web service generation for data sets.

Or is there another way to represent the parent-child join relation and have proxygen genrerate the proper wsdl.

TIA
 

Casper

ProgressTalk.com Moderator
Staff member
I think you should use a longchar as ouput parameter and serialize your dataset. (write-xml).

Casper.
 

pinne65

Member
Is that how it's done?

It sounds like a whole lot of extra work that it seems like proxygen should take care of :-(.

Does anyone know why. This must be a really common situation. I.e. what am I missing here?
 
Hi there,

Dataset support for webservice proxies just wasn't ready for your version of Progress. 10.2 was supposed to add this to ProxyGen, but we're still on 10.1 ourselves so I can't confirm.

Casper's solution is what we ended up using - LONGCHAR parameters in and out to control everything. Luckily, because we could specify the structure of the inbound and outbound XML, this was amazingly easy to do with the READ-XML and WRITE-XML methods of the dataset. All sorted in just a few lines of code.

If you have to produce a specific XML structure outside of that supported by these methods, then you'll have to hand-crank the XML reading and writing, which (as you say) can be a real headache.
 

gcheak

New Member
DB: OpenEdge 10.1C
OS: Windows 2003
Status: Progress Noob

I'm new to the process of getting information over from Progress into .NET.

I've got the AppServer, Proxgen thing down...that works. I just need that last little bit that allows me to "export" temp table data as XML so my .NET app can read it.

Can anyone point me to an example of how this is coded?

Greg
 

gcheak

New Member
Everything I needed to know was in this thread. :blush1:

I just didn't grasp the concept of passing an output parm to carry the data.

DEFINE TEMP-TABLE ttBar LIKE wo_mstr.

DEFINE OUTPUT PARAMETER outData AS LONGCHAR.

/* Fill temp table */

TEMP-TABLE ttBar:WRITE-XML("LONGCHAR", outData, yes, ?, ?, yes, yes).
 
Top