这段时间天天测 WebService ,测得真想吐。
WebService的测试方法,如果WebService中调用的方法需输入的参数本身就是个XML文件时:
参数文件格式:
<?xml version="1.0" encoding="UTF-8"?><root><header><lines><smsuser><id>98d93b3c88cb471881493a1ddcb67d1e</id><batchId>test_batch_id_10</batchId><vipSysId>4037009</vipSysId><phoneNo>54492336aee24329bd9c1682bc3287e6</phoneNo><sendType>2</sendType><content>你好,2012圣诞大促销0</content><sendDate>1351236086340</sendDate><data1>DD53356CC1301C94F810178A8D61BB41</data1><data2>1</data2></smsuser></lines></header></root>
因为提供的参数本身就是XML文件,WebService会把参数当成xml处理,因此需要加上 <![CDATA[ XML文件 ]]>
<![CDATA[<?xml version="1.0" encoding="UTF-8"?><root><header><lines><smsuser><id>98d93b3c88cb471881493a1ddcb67d1e</id><batchId>test_batch_id_10</batchId><vipSysId>4037009</vipSysId><phoneNo>54492336aee24329bd9c1682bc3287e6</phoneNo><sendType>2</sendType><content>你好,2012圣诞大促销0</content><sendDate>1351236086340</sendDate><data1>DD53356CC1301C94F810178A8D61BB41</data1><data2>1</data2></smsuser></lines></header></root>]]>