全部产品
云市场
云游戏

JAVA SDK

更新时间:2020-07-15 09:57:29

JAVA SDK简介

<dependency>
  <groupId>com.aliyun</groupId>
  <artifactId>aliyun-java-sdk-address-purification</artifactId>
  <version>查询最新版本</version>
</dependency>

import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.address_purification.model.v20191118.ClassifyPOIRequest;
import com.aliyuncs.address_purification.model.v20191118.ClassifyPOIResponse;
import com.aliyuncs.profile.DefaultProfile;
public class AddressPurificationTestApp {
    public static void main(String[] args) throws ClientException {
        DefaultProfile profile = DefaultProfile.getProfile(
            "cn-hangzhou",
            "<your-access-key-id>",
            "<your-access-key-secret>");
        IAcsClient client = new DefaultAcsClient(profile);
        ClassifyPOIRequest request = new ClassifyPOIRequest();
        request.setServiceCode("addrp");
        request.setAppKey("xxxxxx");
        request.setText("杭州市文一西路969号");
        request.setDefaultProvince("浙江省");
        request.setDefaultCity("杭州市");
        request.setDefaultDistrict("余杭区");
        ClassifyPOIResponse response = client.getAcsResponse(request);
        System.out.println(response.getData());
    }
}