AWS Api Gateway: Java Client Example

This is a sample of Java Client for AWS Api Gateway.

package com.test.client;
import com.amazonaws.opensdk.config.ConnectionConfiguration;
import com.amazonaws.opensdk.config.ProxyConfiguration;
import com.amazonaws.opensdk.config.TimeoutConfiguration;
import com.test.SampleSDK;
import com.test.model.SampleServiceRequest;
import com.test.model.SampleServiceResult;
public class TestClient {
       SampleSDK sdk;
       public TestClient() {
       private void initSdk() {
              ProxyConfiguration proxy = new ProxyConfiguration(); //optional
              proxy.setProxyHost("x.x.x.x"); //optional
              proxy.setProxyPort(portno);         //optional
              sdk = SampleSDK.builder()
              new ConnectionConfiguration()
              new TimeoutConfiguration()
       public static void main(String[] args) {
              TestClient testClient = new TestClient();
               SampleServiceResult result =testClient.getResult();
               System.out.print("result is:"+result.getSampleResponse().getGreetings());
       public  SampleServiceResult getResult()
              SampleServiceRequest rq = new SampleServiceRequest();   
              SampleServiceResult result = sdk.getSampleJavaLambda(rq);
              return  result;


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s