各位老大,我用asp.net开发了一个用友EAI接口系统,按指定格式导入XML时,回执错误信息为EAI数据源连接失败,原因:登录信息不全,请查看代码!请问该如何解决?如下为c#代码:System.Xml.XmlDocument dom = new XmlDocument();HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:802/U8EAI/import.asp");myRequest.Method = "POST";myRequest.ContentType = @"text/xml;charset=utf-8";dom.Load("c:\\123.xml");System.IO.MemoryStream ms = new System.IO.MemoryStream();dom.Save(ms);byte[] bytes = ms.ToArray();myRequest.ContentLength = bytes.Length;System.IO.Stream s = myRequest.GetRequestStream();s.Write(bytes, 0, bytes.Length);s.Close();System.IO.StreamReader sr = new System.IO.StreamReader(myRequest.GetResponse().GetResponseStream());String retXml = sr.ReadToEnd();sr.Close();dom = new XmlDocument();dom.LoadXml(retXml);//保存返回的信息 dom.Save("C:\\re.xml");
- 2 回答
- 0 关注
- 1152 浏览
添加回答
举报
0/150
提交
取消