Define EGL record from XML
jingqian 2700013WAX Comments (4) Visits (3387)
It has happened more than once, more than twice. Someone asked me to define an EGL record from a snippet of xml string. It is not that hard, but I often get it wrong.
If you've used EGL Rich UI 751, and made REST service calls. You probably have found yourself in the same situation. This process can be tricky depending on what the xml looks like. In the EGL Rich UI 751 User's manual, it talks about the rules for defining EGL record from xml string in details.
Wouldn't it be nice if a tool can do this for you?
We've got one for SOAP web service, from a wsdl file, it can produce EGL interfaces and records. That's because WSDL contains all the information a client needs to call a SOAP service on the server. It reads the WSDL to determine what functions are available on the server. Any special datatypes used are embedded in the form of XML schema.
There isn't such a standard for REST web service. REST web services deal with resources by running CRUD operations on them. The resource is often transmitted in the format of xml or json. In the case of xml, in order for EGL to deserialize xml string into EGL record, you would have to define an EGL record according to the XML structure. That's an error prone process like I mentioned in the beginning.
So as a start, I wrote this EGL RUI application, that converts xml string to EGL record definition
The input can be:
Here are some of the rules and assumptions I made:
You can paste the output EGL record definition into any packages.
Here is the project interchange file you can import to your workspace. The RUI handler is RecordConverter