我用模拟器向这个页面POST一段数据  
<?xml  version  ="1.0"  ?><misc_command  version="1.5"><command_name>provision</command_name><command_data_block><action_id>2</action_id><service_id>55410504</service_id><mid>00100001087879</mid><mobile_id>  </mobile_id><access_mode>2</access_mode></command_data_block>  </misc_command>  
页面代码是  
   Dim  ReceiveStream  As  Stream  =  Request.InputStream()  
               Dim  doc  As  XmlDocument  =  New  XmlDocument  
               doc.Load(ReceiveStream)  
               Dim  objNodeList  As  XmlNodeList  
               objNodeList  =  doc.GetElementsByTagName("action_id")  
               Dim  str  As  String  =  objNodeList(0).InnerXml()  
               Response.Write(str)  
现在页面提示缺少根元素,是怎么回事呢?  
我如果想取得action_id怎么获得呢?救急啊~

解决方案 »

  1.   

    try   Request.InputStream() ===>  Request.InputStream;
      

  2.   

    清华大学计算机课程(教授讲课录像)rm文件(教授讲课录像)为10.51G网络硬盘高速下载.www.8cd.cn
      

  3.   

    试了一下,用下面的脚本post数据
    var docSubmit = new ActiveXObject("Msxml2.DOMDocument");
    docSubmit.loadXML("<?xml  version  ='1.0'  ?><misc_command  version='1.5'><command_name>provision</command_name><command_data_block><action_id>2</action_id><service_id>55410504</service_id><mid>00100001087879</mid><mobile_id>  </mobile_id><access_mode>2</access_mode></command_data_block>  </misc_command>");
    var poster =  new ActiveXObject("Microsoft.XMLHTTP");
    poster.open("POST","receive.aspx", false )
    poster.send(docSubmit);
    alert(poster.responseText);receive.aspx是我自己建的一个接受页面,其page_load里面用你的代码   Dim  ReceiveStream  As  Stream  =  Request.InputStream()  
                   Dim  doc  As  XmlDocument  =  New  XmlDocument  
                   doc.Load(ReceiveStream)  
                   Dim  objNodeList  As  XmlNodeList  
                   objNodeList  =  doc.GetElementsByTagName("action_id")  
                   Dim  str  As  String  =  objNodeList(0).InnerXml()  
                   Response.Write(str) 
    加多一条   Response.End()
    运行完全正确
      

  4.   

    你跟一下 看看str里是什么就知道少不少根元素了
      

  5.   

    我怎么就不能呢?死啊,对了,如果我post回去的话,怎么除了xml语句外还有好多东西包括一些html标志为什么
      

  6.   

    如果我post回去的话,怎么除了xml语句外还有好多东西包括一些html标志为什么
    --当然会有啦,这是你接受post的页面的html, 在               Response.Write(str) 后面加多一条   Response.End()就可以只发送Response.Write的内容了
      

  7.   

    200!!!!!求vb写的webserver接收XML,分析数据后再返回xml的代码