I am a newbie. Does Backendless have any core functions for handling json and web services or I can use third party libraries?
All backendless services handling json. Please describe your use case and we will try to help you
I want to access 3rd party web service from my backendless service. It will require me to send json and also to receive json data. I will like to parse the json data.
What language you would like to use for backendless service, JS or JAVA?
I am using Java to build my services.
Please read the doc https://backendless.com/docs/bl-java/doc.html
for example you have a service:
package com.mbaas;
import com.backendless.Backendless;
import com.backendless.servercode.IBackendlessService;
public class SampleService implements IBackendlessService
{
public WeatherInfo getWeather( SomeJsonObject arg )
{
String plainJson = //call to external service to get data
WeatherInfo weatherInfo = // use some json parser that you like to convert String to JSON, for example GSON
return weatherInfo;
}
}
deploy the code with coderunner. and now you can call the service read here how to work with service https://backendless.com/docs/bl-java/doc.html#bl_working_with_the_service2
I don’t see anywhere that WeatherInfo is defined. Does it have a URL? REST Endpoint, headers?
It is just an example, your class can be instead of WeatherInfo
, so it does not matter what fields are in the class