eBay开发 ---接口对接(获得上下文对象)

package eBay.util;

import com.ebay.sdk.ApiAccount;
import com.ebay.sdk.ApiContext;

public class GetContext {
	
	//实例化context 并且设置开发人员账号 
	public ApiContext getContext(){
		
		//实例化
		ApiContext context=new ApiContext();
		//设置开发人员账号
		context.getApiCredential().getApiAccount().setApplication("shangban-e7a8-4940-ba0a-38b244dbac93");
		context.getApiCredential().getApiAccount().setCertificate("20411b73-eebf-4a7b-8cbe-8bbbf1948966");
		context.getApiCredential().getApiAccount().setDeveloper("e45c00f7-26dc-458e-bcd3-ce8907a78924");
		
		context.setApiServerUrl("https://api.sandbox.ebay.com/wsapi");
		return context;
	}
}

 

你可能感兴趣的:(接口)