TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
TrainAgentOrderLockRequest req = new TrainAgentOrderLockRequest();
TrainAgentOrderLockRequest.LockOrderRQ obj1 = new TrainAgentOrderLockRequest.LockOrderRQ();
List<TrainAgentOrderLockRequest.TicketDTO> list3 = new ArrayList<TrainAgentOrderLockRequest.TicketDTO>();
TrainAgentOrderLockRequest.TicketDTO obj4 = new TrainAgentOrderLockRequest.TicketDTO();
list3.add(obj4);
obj4.setFromStationName("武威");
obj4.setInterChangeStationTelecode("BJG");
obj4.setInterChangeStationName("北京");
obj4.setTrainCode("Z42");
obj4.setTtpOrderId(1234L);
obj4.setSeatTypeCode("1");
obj4.setSeatTypeName("硬座");
obj4.setRealTicketPrice(13100L);
obj4.setToStationName("乌鲁木齐");
obj4.setFromStationTelecode("WUJ");
obj4.setVipCustomType(1L);
obj4.setSubOrderId(12345L);
obj4.setTrainDate("2021-12-25");
obj4.setSegmentId(1434L);
obj4.setFromTime("4:04");
obj4.setSegmentIndex(1L);
obj4.setSeatNo("11号");
obj4.setToStationTelecode("WAR");
obj4.setToTime("9:01");
obj4.setSequenceNo("E4253453");
obj4.setBatchNo("1");
obj4.setCoachNo("09");
obj4.setTicketTypeCode("1");
obj1.setTickets(list3);
obj1.setTtpOrderId(1234L);
req.setParam(obj1);
TrainAgentOrderLockResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
TrainAgentOrderLockRequest req = new TrainAgentOrderLockRequest();
TrainAgentOrderLockRequest.LockOrderRQDomain obj1 = new TrainAgentOrderLockRequest.LockOrderRQDomain();
List<TrainAgentOrderLockRequest.TicketDTODomain> list3 = new List<TrainAgentOrderLockRequest.TicketDTODomain>();
TrainAgentOrderLockRequest.TicketDTODomain obj4 = new TrainAgentOrderLockRequest.TicketDTODomain();
list3.Add(obj4);
obj4.FromStationName = "武威";
obj4.InterChangeStationTelecode = "BJG";
obj4.InterChangeStationName = "北京";
obj4.TrainCode = "Z42";
obj4.TtpOrderId = 1234L;
obj4.SeatTypeCode = "1";
obj4.SeatTypeName = "硬座";
obj4.RealTicketPrice = 13100L;
obj4.ToStationName = "乌鲁木齐";
obj4.FromStationTelecode = "WUJ";
obj4.VipCustomType = 1L;
obj4.SubOrderId = 12345L;
obj4.TrainDate = "2021-12-25";
obj4.SegmentId = 1434L;
obj4.FromTime = "4:04";
obj4.SegmentIndex = 1L;
obj4.SeatNo = "11号";
obj4.ToStationTelecode = "WAR";
obj4.ToTime = "9:01";
obj4.SequenceNo = "E4253453";
obj4.BatchNo = "1";
obj4.CoachNo = "09";
obj4.TicketTypeCode = "1";
obj1.Tickets= list3;
obj1.TtpOrderId = 1234L;
req.Param_ = obj1;
TrainAgentOrderLockResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new TrainAgentOrderLockRequest;
$param = new LockOrderRQ;
$tickets = new TicketDTO;
$tickets->from_station_name="武威";
$tickets->inter_change_station_telecode="BJG";
$tickets->inter_change_station_name="北京";
$tickets->train_code="Z42";
$tickets->ttp_order_id="1234";
$tickets->seat_type_code="1";
$tickets->seat_type_name="硬座";
$tickets->real_ticket_price="13100";
$tickets->to_station_name="乌鲁木齐";
$tickets->from_station_telecode="WUJ";
$tickets->vip_custom_type="1";
$tickets->sub_order_id="12345";
$tickets->train_date="2021-12-25";
$tickets->segment_id="1434";
$tickets->from_time="4:04";
$tickets->segment_index="1";
$tickets->seat_no="11号";
$tickets->to_station_telecode="WAR";
$tickets->to_time="9:01";
$tickets->sequence_no="E4253453";
$tickets->batch_no="1";
$tickets->coach_no="09";
$tickets->ticket_type_code="1";
$param->tickets = $tickets;
$param->ttp_order_id="1234";
$req->setParam(json_encode($param));
$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.agent.order.lock' \
-d 'partner_id=apidoc' \
-d 'session=7379c4ab-2355-45ff-a1e2-9c0bb3cb480d' \
-d 'sign=E879843E6A66378A37A64A278BF4A452' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-01-29+07%3A49%3A33' \
-d 'v=2.0' \
-d 'param=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.TrainAgentOrderLockRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.param="数据结构示例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.agent.order.lock");
add_param(pRequest,"param","数据结构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.agent.order.lock', {
'param':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})