返回首页

如何读请求通过COM组件(MSXML2.ServerXMLHTTPClass())发布时间:您好,
我需要帮助我代码migration.Thanks中提前。

我有一个asp代码被迁移到ASP.NET(目前的ASP代码使用COM组件(的Server.CreateObject("MSXML2.ServerXMLHTTP"))发表的数据,到合作伙伴系统(远程服务器)我已迁移到NET)
问题:
我面临的困难,在确定如何读取在我的网页请求(XML数据)融合系统通过WebService的发布,这是通过"POST"方法。
融合系统要通过"HTTP POST发送到网页的xml数据??方法和我们的网页上读取请求和发送到合作伙伴系统的XML数据(远程系统)。
下面是示例代码,这是由融合用于发布的数据:


string sPostURL =(string) Utility.RegUtil.getAppConfig("PostURL",typeof(System.String));

string sPostURLUser=(string) Utility.RegUtil.getAppConfig("PostURLUser",typeof(System.String));

string sPostURLPassword=(string) Utility.RegUtil.getAppConfig("PostURLPassword",typeof(System.String));

string sHTTPResponse = "";

MSXML2.ServerXMLHTTPClass objXMLPost = new MSXML2.ServerXMLHTTPClass();

objXMLPost.setTimeouts(60000, 60000, 300000, 60000);

objXMLPost.open("POST", sPostURL, false, sPostURLUser,sPostURLPassword);

objXMLPost.setRequestHeader("Content-Type", "text/xml");

objXMLPost.send(sXmlToPost);

while (objXMLPost.readyState != 4)

{

//Application.DoEvents();

}

sHTTPResponse = objXMLPost.responseText;

if (objXMLPost.status !=200)

sHTTPResponse="";

return sHTTPResponse;

在我的C#。NET应用程序中,我试图使用HttpWebRequest和HttpWebResponse发表的数据,到合作伙伴系统。

回答