I'm trying to invoke AWS Lambda code via the AWS Java SDK, but it is producing a strange error that i've only found on google as a defect that was supposedly fixed a while ago.
The service name : "BackplaneExecutionService" identified from the payload does not agree with the service name : "AWSLambda" specified in the transport header (Service: AWSLambda; Status Code: 403; Error Code: AccessDeniedException; Request ID: c40b5e2e-807b-11e5-88d6-6f0496ed99c7) com.amazonaws.AmazonServiceException: The service name : "BackplaneExecutionService" identified from the payload does not agree with the service name : "AWSLambda" specified in the transport header (Service: AWSLambda; Status Code: 403; Error Code: AccessDeniedException; Request ID: c40b5e2e-807b-11e5-88d6-6f0496ed99c7) at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:710) at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:385) at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:196) at com.amazonaws.services.lambda.AWSLambdaClient.invoke(AWSLambdaClient.java:387) at com.amazonaws.services.lambda.AWSLambdaClient.invoke(AWSLambdaClient.java:322) at .....
My code to invoke this looks like:
BasicAWSCredentials androidClientCredentials = new BasicAWSCredentials(
"cccccccc",
"ccc+cc/cc"
);
AWSLambdaClient lambdaClient = new AWSLambdaClient(androidClientCredentials);
lambdaClient.setRegion(Region.getRegion(Regions.US_EAST_1));
lambdaClient.setEndpoint("https://cc.execute-api.us-east-1.amazonaws.com/prod/asdf");
lambdaClient.setServiceNameIntern("execute-api");
InvokeRequest request = new InvokeRequest();
request.setInvocationType(InvocationType.RequestResponse);
request.setFunctionName("arn:aws:lambda:us-east-1:1234:asdf:$LATEST");
Map<String,String> payload = new HashMap<>(4);
payload.put("username",U);
payload.put("password", P);
request.setPayload(ByteBuffer.wrap(new JSONObject(payload).toString().getBytes()));
InvokeResult result = lambdaClient.invoke(request);
Any thoughts or direction?