Question Building A Flexible Web Service

stevietee

New Member
Hi. I am using OpeneEdge 10.1c to build a web service which will expose elements of an already well established ERP for use with a SOAP client.

Its been a struggle If I am honest but I managed to get a proof of concept developed before Christmas which involved the following

1. Create a SalesOrder.p. This accepts a DATASET as an input parameter which is made up of a number of linked TEMP-TABLES.
2. Ran Proxygen
3. Deployed webservice in LINUX environment

This all seems to work and the generated WSDL accurately shows how to build the XML to access the webservice based upon the DATASET input parameter.

All Good.

However the client wants the Web Service to be flexible. i.e. he cant guarantee that the users accessing the web service will be able to use the format of XML described by the web service and would like it to be flexible enough to accept the XML the client can provide, which the web service then translates into the standard, possibly using xsltproc.

My first thought here is to create a variation of SalesOrder.p which accepts one LONGCHAR input parameter; load the supplied XML into memory and then push it through xsltproc.

Is this the best way to do it (probably not!) and is it possible to do something like this and still provide a useful WSDL??

Hope all that makes sense - Very new to this side of things so forgive me if my question is nonsensical!
 

joey.jeremiah

ProgressTalk Moderator
Staff member
hello stevietee,

wsdl was probably the recommended way to do things awhile ago.

i think, wsdl was just so much more complicated than rest that most people opted for rest ymmv. just simple xml or most likely json over http/s.

i would use webspeed not the webservice adapter because it is so much easier to setup and maintain and there's no java servers to install, confirgure, maintain etc. plus you could get the users ip address.

i wrote a gateway.p procedure that all requests pass through and also a login.p for login and returning a session id.

hth
 

stevietee

New Member
Thanks for the reply Joey.

That's interesting, I had not considered webspeed (doh!). Since it would be accessed from non-OpenEdge clients I assume it can handle XML being POSTED, as well as GET requests?
 

GregTomkins

Active Member
We use WebSpeed mostly for our own applications and some WSDL for clients who like that sort of thing to access our API's. +1 for WSDL is a pain to setup and arguably overly complicated.

For your example, you are talking about using WebSpeed to ingest some random XML, run it through xsltproc, then send the resultant transformed XML to a WSA and eventually another AppServer?

That sounds crazy convoluted. Depending how flexible you are willing to be in letting your clients use whatever format they choose, I'd consider just doing it (the transformation) directly in WebSpeed/ABL. Sure it's going to be a pain of hard-code, but so would an XSLT, and at least the surrounding environment would be simple.

In any case, yeah, WSDL seems a bit meaningless if you're going to let your clients send you input in whatever format they feel like.

I think you really need to nail down how flexible is "flexible enough". If you are just talking about them making up their own tag names, but the overall structure being the same, you could just have a little mapping file/table in ABL that translates everything down into a static temp-table structure that you pass along into the downstream processing code.
 
Top