zoukankan
html css js c++ java
delphi下使用http協議post方式發送xml數據到asp頁面和aspx頁面
delphi端的發送代碼
function Tverpipxinfo.postXml(
const
xmlstr, url: WideString): WideString;
var
idHttp:TIdHTTP;
sends:tstrings;
IdEncoderMIME1:TIdEncoderMIME;
begin
result:
=
''
;
try
idHttp:
=
TIdHTTP.Create(nil);
idHttp.Request.ContentType :
=
'
application/x-www-form-urlencoded
'
;
IdEncoderMIME1:
=
TIdEncoderMIME.Create(nil);
sends:
=
tstringlist.Create;
sends.Add(
'
xmlstr=
'
+
IdEncoderMIME1.Encode(xmlstr));
result:
=
idhttp.Post(url,sends);
except
on E:Exception
do
begin
result:
=
e.Message;
end;
end;
idHttp.Free;
IdEncoderMIME1.Free;
sends.Free;
end;
asp端接收方法
<
%@ Language
=
VBScript %
>
<
%
'
On Error Resume Next
xmlstr
=
Request.form(
"
xmlstr
"
)
set
xmlobj
=
server.
CreateObject
(
"
microsoft.xmldom
"
)
xmlobj.loadXML xmlstr
Response.ContentType
=
"
text/xml
"
%
>
<
?xml version
=
"
1.0
"
encoding
=
"
big5
"
?
>
<
%
Response.Write xmlobj.xml
set
xmlobj
=
nothing
%
>
aspx端接收方法
private
void
Page_Load(
object
sender, System.EventArgs e)
{
string
str
=
""
;
string
reqstr
=
""
;
try
{
XmlDocument doc
=
new
XmlDocument();
//
doc.Load(Request.InputStream);
reqstr
=
Request.Form[
"
xmlstr
"
];
reqstr
=
Encoding.GetEncoding(
"
big5
"
).GetString(Convert.FromBase64String(reqstr));
doc.LoadXml(reqstr);
doc.Save(
"
d:/test.xml
"
);
Response.Write(
"
How are you
..
"
);
}
catch
(Exception e1)
{
str
=
e1.Message;
}
Response.Write(
"
str ==
"
+
str);
}
查看全文
相关阅读:
python 多线程测试
python 多线程join()
python 多线程 t.setDaemon(True):
线程锁
python 多线程
模板渲染和参数传递.
求两个数组的交集
java数组并集/交集/差集(补集)
java各种集合的线程安全
页面跳转和重定向
原文地址:https://www.cnblogs.com/oisiv/p/179633.html
最新文章
Shiro+Spring+Struts2集成演示权限控制
安装Django
cookie和session
Caused by: java.lang.ClassNotFoundException: com.alibaba.druid.support.http.StatViewServlet
It's likely that neither a Result Type nor a Result Map was specified
ERROR 1018 (HY000): Can't read dir of './cmp/' (errno: 13)
python 面向对象__call__
java.lang.IllegalArgumentException: Invalid character (CR or LF) found in method name
rsyslog 客户端配置
python 多线程另外一种写法
热门文章
简单实现Shiro单点登录(自定义Token令牌)
Parallel::ForkManage: 一个简单的并行进程用于fork管理:
perl 多进程抽取oracle数据
AES加密解密Windows下跟linux下结果不同的解决方案
python 多线程 公用一个连接
System.Data.SqlClient.SqlError: 备份集中的数据库备份与现有的 'cmp' 数据库不同
1075-Incorrect table definition;there can be only one auto column and it must be defined as a key
python 多线程串行和并行
perl 回调函数
perl 多进程
Copyright © 2011-2022 走看看