什么是接口测试

上一篇 / 下一篇  2015-06-10 11:10:50 / 个人分类:接口测试

  接口分两种,一个是同一个系统中模块与模块间的接口,一个是跨系统平台与平台间的对接,而我现在要介绍的是第二种。

  接口测试的原理是通过测试程序模拟客户端向服务器发送请求报文,服务器接收请求报文后对相应的报文做出处理然后再把应答报文发送给客户端,客户端接收应答报文这一个过程。

  下面看一实例,订单管理系统和仓储系统直接的对接,看看订单管理系统中的订单上传到仓储系统中:

1、创建上传的请求报文
<wmsSailOrderRequest><checkword>01f18980363f40e48416464baf4cc7c0</checkword><header><company>YLLZ</company><warehouse>755DCA</warehouse><shop_name>sandbox_c_1</shop_name><erp_order>B24_YLLZSF-20140721-00006</erp_order><order_type>销售订单</order_type><order_date>2014-07-21 16:01:38</order_date><ship_to_name>某某</ship_to_name><ship_to_attention_to>某某</ship_to_attention_to><ship_to_country /><ship_to_province>湖南省</ship_to_province><ship_to_city>常德市</ship_to_city><ship_to_area>澧县</ship_to_area><ship_to_address>华天国家大学</ship_to_address><ship_to_postal_code>415500</ship_to_postal_code><ship_to_phone_num>18688840942</ship_to_phone_num><ship_to_tel_num>0571-58188188</ship_to_tel_num><carrier>顺丰速运</carrier><carrier_service /><route_numbers /><packing_note /><complete_delivery>Y</complete_delivery><cod>N</cod><self_pickup>N</self_pickup><value_insured /><declared_value /><return_receipt_service /><delivery_date /><delivery_requested>周一至周五、周末均可配送</delivery_requested><invoice>N</invoice><invoice_type>普通**</invoice_type><invoice_title /><invoice_content /><order_note /><company_note /><priority /><order_total_amount>30.00</order_total_amount><monthly_account>7550144315</monthly_account></header><detailList><item><erp_order_line_num>115</erp_order_line_num><item>SF002</item><item_name>顺丰商品002</item_name><uom>个</uom><qty>1.00</qty></item></detailList></wmsSailOrderRequest>

2、仓储接收请求报文后对相应的报文做出处理然后给出的应答报文
<?xml version="1.0" encoding="UTF-8"?>
<wmsSailOrderResponse>
  <orderid>B24_YLLZSF-20140721-00006</orderid>
  <result>1</result>
  <remark>已成功导入1条订单数据! </remark>
</wmsSailOrderResponse>


TAG: 接口

fonona的个人空间 引用 删除 fonona   /   2016-06-12 01:04:17
1
ccg890811的个人空间 引用 删除 ccg890811   /   2015-06-10 16:40:02
-3
 

评分:0

我来说两句

Open Toolbar