BusinessObjects Board

REST Web Service JSON

I am trying to connect to a REST Web Service which outputs JSON. I have used SOAPUI to create the WADL and could import the function successfully. However there was no response tag created in the WADL and so while the function call successfully connected to the web service, the result set wasn’t written to my temp table.

A bit of digging on the SAP Support Portal has got me a note (2230626) which talks about how a WADL generated by SOAPUI may not have a response/reply element and how the WADL file needs to be amended and an XSD provided.

I’ve used the examples in the note to amend my WADL but I’m not sure if I need to reference an XSD in the Grammars element for this to work. And if I do need to reference an XSD then what format do I used when the output is a JSON array?

Can’t seem to find much on this online but any ideas gratefully received.

Matt


Matt Rogers (BOB member since 2015-11-20)

if you expect a response either json or xml, you will have to specify the schema of the response it can be declared with the response or you can reference it from a XSD

if you are able to generate WADL from SoapUI, when making the call, you will see a tab under response named schema if you click on that you can get the response schema, depending on your response you may get multiple schemas

if the service provider is not giving an WADL that you can use, then yes, it can be little tricky to get the WADL

is this a public service ? if yes, let me know the link I can generate a WADL for you
or
Open a support case, let me know the number I can take a look


manoj_d (BOB member since 2009-01-02)

Hi Manoj_d, thanks for your reply

The Web service I’m using is

http://api.openweathermap.org/data/2.5/weather?q=London,uk&appid=2de143494c0b295cca9337e1e96b00e0

I have used soap UI but don’t seem to get a response under schema tab.

I think I just need some guidance around how the xsd file needs to look in order to hold the JSON Object returned by the web service?

Matt


Matt Rogers (BOB member since 2015-11-20)

extract the attached WALD and XSD file to a folder, create a new WebService REST Datastore and point to this WADL file, import getWeather function

also, attached is the SOAPUI screen, showing how to get the schema
under the response, click on Schema, the click on Conflicts tab, select Auo-Resolve, you will get some prompts click yes/ok
Select schema tab, you can see the schema namespaces, select each and you can see the XSD, select all and save this to a file, if you have multiple namespaces same all of them to separate files and use them in WADL file
WeatherREST.zip (176.0 KB)


manoj_d (BOB member since 2009-01-02)

thanks Manoj_d - will take a look - appreciate your help.


Matt Rogers (BOB member since 2015-11-20)

I am facing issue with importing a .json file, does the .json files needs to be converted to a WADL file or .XSD to import?

Any help is much appreciated.

Regards,
Fahad


boalikhan (BOB member since 2015-10-27)

Manoj- I see under Schemas the “ns:#” in target name space but how do I go about combining the multiple schemas I see in SOAPUI?

Any help?

Regards,
Adnan


boe_bods :india: (BOB member since 2008-03-14)