cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SAP CUSTOMER CHECKOUT PLUGIN - REST WEB SERVICE

silambarasan_RS
Active Contributor
0 Kudos
754

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

Accepted Solutions (1)

Accepted Solutions (1)

R_Zieschang
Contributor

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

silambarasan_RS
Active Contributor
0 Kudos

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.

R_Zieschang
Contributor
0 Kudos

Hello silambarasan.rajendran ,

I think this is more like a architectural question first of all which then would dictate how to implement. Are we talking about SAP Business One as backends therefore the SAP Business Service Layer is available?

Kind regards

Robert

silambarasan_RS
Active Contributor
0 Kudos

Hello Robert Zieschang,

We implement the REST Service successfully.

Thanks for the support.

R_Zieschang
Contributor
0 Kudos

Hi silambarasan.rajendran ,

glad to hear.

Regards

Robert

Answers (0)