on 2018 Dec 31 7:11 AM
Dear Expert,
I am doing CCO plugin development verson : 2.0 FP7 PL00 with SAP Business One version for HANA. is there possibility REST WEB SERVICE to integrate with SAP Business One version for HANA. Pls help us.
Thanks & Regards,
Sathish
Request clarification before answering.
Hello Sathish,
yes, this is possible. I am using the feign client for my plugins to interact with rest web services.
Does the rest service you want to interact with already exists?
Take a look at https://www.baeldung.com/intro-to-feign
You just declare an interface which represent your rest api like this:
public interface RestApiClient {
@RequestLine ("GET /{param1}")
YourObject getObject(@Param("param1") String sParam);
@RequestLine("POST")
void createObject(YourObject inObject);
}
Then you need to create the feign client with the builder pattern, where you are able to define which encoder and decoder should be used (feign automatically (de)serializes the JSON Response/Requests), the url where the api endpoint resides and so on...
RestApiClient apiClient = Feign.builder()
.client(new ApacheHttpClient())
.encoder(new JacksonEncoder())
.decoder(new JacksonDecoder())
.target(RestApiClient.class, "http://url.tothe.api/v2/");
When the client is up, you now can access the methods of your RestApiClient Interface (see above) like this:
apiClient.getObject("A00001");
apiClient.createObject(....);
Drop me a line if you need any further hints or assistance.
Regards
Robert
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Robert Zieschang,
Thanks for the response, I tried a lot but cant get my solution.
I need to Establish Connection between CCO Plugin to HANA DB and retrieve/Update data using Queries.
Kindly help us to solve this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.