[RESTWebServices] What about XSD schemas?

[RESTWebServices] What about XSD schemas?

Forge Component
Published on 2013-06-02 by Ricardo Silva
7 votes
Published on 2013-06-02 by Ricardo Silva
Just sharing if i can save somebody else a good bunch of time like I did.

I was looking for automated structure building from an RESTful service providing very complex and XML only based answers instead of JSON. It seems there is not yet a "plug and play" component to create structures from XML.

Fortunately they provided the XSD files with all schemas. I could use "XML Spy" from Altova (30 day trial full featured available), which allowed me to create a sample XML file from the XSD schema, and then convert into JSON.

Copy/pasting this JSON text into RESTWebServices will do the rest and I now have saved probably at least 1 full day if I would have had to set up all structures manually...

NB: I had to modify RESTWebervices to extend the length of the JSON input text beyond the original 20,000 value.

I'm glad you were able to successfully use my component for this task, and specially that it was useful in saving you development time (which is its main purpose) :)

In your use-case, since you already have a xsd for the data, it might have been easier to simply build a WSDL using the data from that XSD to import in Service Studio instead of going from XSD -> JSON -> "XSD" again.

I will consider the possibility of including support for generating WSDL's based on XML (since that's also a common REST use case) into this component.

For now purely academic purposes can you share with us the service you're trying to integrate with, either by pointing us to its documentation or sharing the XSD and JSON files you used? This will help me better understand the problem you're facing to try and come up with an acceptable, appropriate and hopefully simple solution for it (if I decide to go in that direction).
Thx, Ricardo.

Actually, as I am not that developer expert nor that used to XML/XSD/WSDL stuff, I have not found an easy way to directly go from XSD to WSDL, so I chose to convert into JSON (knowing your component would do the rest :)). Actually, I just needed to get the structures in place so that i then could use XML records extension (versus a web service).

The XSDs are coming from product search kelkoo service here, which includes and refers to this one.

I could use XMLSpy from Altova: i opened the XSD, used function to create a sample XML file from it, then converted to JSON.

Hopefully that'll be actionnable enough to work with?