When I tried "DoesBucketExistRequest" with wrong accessKey intentionally, the CosServerException catched has a null errorcode, which makes this exception meaningless.
According to support team's reply, this problem can be solved by manully changing the method of the request to "GET". Because the the original method of th request is "HEAD", which has no body in the response.
When I tried "DoesBucketExistRequest" with wrong accessKey intentionally, the CosServerException catched has a null errorcode, which makes this exception meaningless.
But the "GetServiceRequest" works fine.