TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
TrainStopAgentCallbackRequest req = new TrainStopAgentCallbackRequest();
TrainStopAgentCallbackRequest.TrainAgentStopInfo obj1 = new TrainStopAgentCallbackRequest.TrainAgentStopInfo();
obj1.setTrainNo("G123");
obj1.setDepTime("2022-07-31 10:12:00");
obj1.setFromStation("北京南");
obj1.setToStation("杭州东");
obj1.setTrainStatus("STOP");
obj1.setUuid("46d32867-15b2-443a-9d18-a00e21239fca");
req.setTrainAgentStopInfo(obj1);
TrainStopAgentCallbackResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
TrainStopAgentCallbackRequest req = new TrainStopAgentCallbackRequest();
TrainStopAgentCallbackRequest.TrainAgentStopInfoDomain obj1 = new TrainStopAgentCallbackRequest.TrainAgentStopInfoDomain();
obj1.TrainNo = "G123";
obj1.DepTime = "2022-07-31 10:12:00";
obj1.FromStation = "北京南";
obj1.ToStation = "杭州东";
obj1.TrainStatus = "STOP";
obj1.Uuid = "46d32867-15b2-443a-9d18-a00e21239fca";
req.TrainAgentStopInfo_ = obj1;
TrainStopAgentCallbackResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new TrainStopAgentCallbackRequest;
$train_agent_stop_info = new TrainAgentStopInfo;
$train_agent_stop_info->train_no="G123";
$train_agent_stop_info->dep_time="2022-07-31 10:12:00";
$train_agent_stop_info->from_station="北京南";
$train_agent_stop_info->to_station="杭州东";
$train_agent_stop_info->train_status="STOP";
$train_agent_stop_info->uuid="46d32867-15b2-443a-9d18-a00e21239fca";
$req->setTrainAgentStopInfo(json_encode($train_agent_stop_info));
$resp = $c->execute($req, $sessionKey);
curl -X POST 'http://gw.api.taobao.com/router/rest' \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'app_key=12129701' \
-d 'format=json' \
-d 'method=taobao.train.stop.agent.callback' \
-d 'partner_id=apidoc' \
-d 'session=3f3e110e-116f-463d-87ad-ac374ce4ed1d' \
-d 'sign=D34BFDF18C71B3EA8FC4D6EE971D4C07' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-11-21+16%3A52%3A56' \
-d 'v=2.0' \
-d 'train_agent_stop_info=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.TrainStopAgentCallbackRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.train_agent_stop_info="数据结构示例JSON格式"
try:
resp= req.getResponse(sessionkey)
print(resp)
except Exception,e:
print(e)
pTopRequest pRequest = alloc_top_request();
pTopResponse pResponse = NULL;
pTaobaoClient pClient = alloc_taobao_client(url, appkey, appsecret);
set_api_name(pRequest,"taobao.train.stop.agent.callback");
add_param(pRequest,"train_agent_stop_info","数据结构JSON示例");
pResponse = top_execute(pClient,pRequest,sessionKey);
printf("ret code:%d\n",pResponse->code);
if(pResponse->code == 0){
pTopResponseIterator ite = init_response_iterator(pResponse);
pResultItem pResultItem = alloc_result_item();
while(parseNext(ite, pResultItem) == 0){
printf("%s:%s\n",pResultItem->key,pResultItem->value);
}
destroy_response_iterator(ite);
destroy_result_item(pResultItem);
}
destroy_top_request(pRequest);
destroy_top_response(pResponse);
destroy_taobao_client(pClient);
TopClient = require('./topClient').TopClient;
var client = new TopClient({
'appkey': 'appkey',
'appsecret': 'secret',
'REST_URL': 'http://gw.api.taobao.com/router/rest'
});
client.execute('taobao.train.stop.agent.callback', {
'train_agent_stop_info':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})