首页 新闻 会员 周边

关于asp.net中WebServer测试错误问题

0
悬赏园豆:20 [待解决问题]

vs2012开发了webserver服务测试的问题:

将测试数据:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:acc="http://nm.cmcc.com/usersync/account">
   <soap:Header/>
   <soap:Body>
      <acc:addUserInfo>
         <!--Optional:-->
         <acc:userInfos>&lt;?xml version="1.0" encoding="UTF-8"?>&lt;accounts>&lt;account>&lt;o>00420079214000000000&lt;/o>&lt;preferredMobile>15904874651&lt;/preferredMobile>&lt;cn>张楠&lt;/cn>&lt;displayOrder>00420079214000000000/200&lt;/displayOrder>&lt;uid>zhangnan5&lt;/uid>&lt;duty>00420079214000000000-1007&lt;/duty>&lt;/account>&lt;/accounts></acc:userInfos>
      </acc:addUserInfo>
   </soap:Body>
</soap:Envelope>

改为:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
   <soap:Header/>
   <soap:Body>
      <addUserInfo>
         <!--Optional:-->
         <userInfos>&lt;?xml version="1.0" encoding="UTF-8"?>&lt;accounts>&lt;account>&lt;o>00420079214000000000&lt;/o>&lt;preferredMobile>15904874651&lt;/preferredMobile>&lt;cn>张楠&lt;/cn>&lt;displayOrder>00420079214000000000/200&lt;/displayOrder>&lt;uid>zhangnan5&lt;/uid>&lt;duty>00420079214000000000-1007&lt;/duty>&lt;/account>&lt;/accounts></acuserInfos>
      </addUserInfo>
   </soap:Body>
</soap:Envelope>

测试失败:

失败返回为:  <soap:Text xml:lang="en">System.Web.Services.Protocols.SoapException: The request element &lt;addUserInfo xmlns=''> was not recognized.

请各位大侠帮忙看看是什么问题?非常感谢!

whbchrish的主页 whbchrish | 初学一级 | 园豆:159
提问于:2013-07-19 13:22
< >
分享
所有回答(3)
0

你故意把对的改成错的上来问,你把命名空间和前缀都去掉了,xml解析出错了,给分吧

天边彩云 | 园豆:629 (小虾三级) | 2013-07-19 14:18

哈哈

支持(0) 反对(0) 空明流光 | 园豆:106 (初学一级) | 2013-07-19 14:40
0

你只在考验大家的纠错技术吗?命名空间和前缀去掉是不能解析xml的。

妍珊 | 园豆:1169 (小虾三级) | 2013-07-19 15:37
0

已经解决了

whbchrish | 园豆:159 (初学一级) | 2013-07-19 15:44
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册