chingfeng提到:
ebay
大師哪一段你來不及研究......
/**
*
* @author Suzanne Ahmed suzanne.ahmed@ebay.com
*
*/
public class CallJsdk {
public static void main(String[] args) throws MalformedURIException, RemoteException {
// Read properties file to load developer credentials
Properties keys = new Properties();
try {
keys.load(new FileInputStream("keys.properties"));
} catch (IOException e) {
System.out.println(e);
}
// set credentials in ApiAccount
ApiAccount account = new ApiAccount();
account.setDeveloper( keys.getProperty("devId") );
account.setApplication( keys.getProperty("appId") );
account.setCertificate( keys.getProperty("certId") );
// set credentials in ApiCredential
ApiCredential credential = new ApiCredential();
credential.setApiAccount( account );
credential.seteBayToken( keys.getProperty("token") );
// add ApiCredential to ApiContext
ApiContext context = new ApiContext();
context.setApiCredential(credential);
// set eBay server URL to call
context.setApiServerUrl( "https://api.sandbox.ebay.com/wsapi" ); // sandbox
// set timeout in milliseconds - 3 minutes
context.setTimeout(180000);
// set wsdl version number
context.setWSDLVersion("423");
// turn on logging to standard out
ApiLogging logging = new ApiLogging();
logging.setEnableLogging(true);
logging.setLogSOAPMessages(true);
logging.setLogExceptions(true);
context.setApiLogging(logging);