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><?xml version="1.0" encoding="UTF-8"?><accounts><account><o>00420079214000000000</o><preferredMobile>15904874651</preferredMobile><cn>张楠</cn><displayOrder>00420079214000000000/200</displayOrder><uid>zhangnan5</uid><duty>00420079214000000000-1007</duty></account></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><?xml version="1.0" encoding="UTF-8"?><accounts><account><o>00420079214000000000</o><preferredMobile>15904874651</preferredMobile><cn>张楠</cn><displayOrder>00420079214000000000/200</displayOrder><uid>zhangnan5</uid><duty>00420079214000000000-1007</duty></account></accounts></acuserInfos>
</addUserInfo>
</soap:Body>
</soap:Envelope>
测试失败:
失败返回为: <soap:Text xml:lang="en">System.Web.Services.Protocols.SoapException: The request element <addUserInfo xmlns=''> was not recognized.
请各位大侠帮忙看看是什么问题?非常感谢!
你故意把对的改成错的上来问,你把命名空间和前缀都去掉了,xml解析出错了,给分吧
哈哈
你只在考验大家的纠错技术吗?命名空间和前缀去掉是不能解析xml的。
已经解决了