请各位大侠帮写一个操作XML的ASP
// 下面是一段 Delphi 的过程,麻烦各位大虾转为为ASP, 感谢!
function TForm1.dg(Const tid,spid,dq,zhujiao,serverid:string):string;
{
Tid: 时间流水号,如:spid+FormatDatetime('yymmddmmss',Now)
SpID: 企业代码,如924579
Dq: SP所在地区,如XX省的DQ是0028
Zhujiao:手机号
Serviceid:业务代码
}
var
xhttp: Variant;
XmlBody:string;
SendText:TStringList;
hRet:string;
begin
SendText:=TStringList.Create;
Try
SendText.Add('<?xml version="1.0" encoding="UTF-8" ?>');
SendText.Add('<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" ');
SendText.Add('xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd=http://www.w3.org/2001/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns="http://www.monternet.com/dsmp/schemas/">');
SendText.Add('<SOAP-ENV:Header>');
SendText.Add(Format('<TransactionID xmlns="http://www.monternet.com/dsmp/schemas/" xsi:type="xsd:string">%s</TransactionID>',[tid]));
SendText.Add('</SOAP-ENV:Header>');
SendText.Add('<SOAP-ENV:Body>');
SendText.Add('<SubscribeServiceReq xmlns="http://www.monternet.com/dsmp/schemas/">');
SendText.Add('<Version>1.5.0</Version>');
SendText.Add('<MsgType>SubscribeServiceReq</MsgType>');
SendText.Add('<Send_Address>');
SendText.Add('<DeviceType>400</DeviceType>');
SendText.Add(Format('<DeviceID>%s</DeviceID>',[spID]));
SendText.Add('</Send_Address>');
SendText.Add('<Dest_Address>');
SendText.Add('<DeviceType>0</DeviceType>');
SendText.Add(Format('<DeviceID>%s</DeviceID>',[dq]));
SendText.Add('</Dest_Address>');
SendText.Add('<FeeUser_ID>');
SendText.Add('<UserIDType>1</UserIDType>');
SendText.Add(Format('<MSISDN>%s</MSISDN>',[zhujiao]));
SendText.Add('<PseudoCode />');
SendText.Add('</FeeUser_ID>');
SendText.Add('<DestUser_ID>');
SendText.Add('<UserIDType>1</UserIDType>');
SendText.Add(Format('<MSISDN>%s</MSISDN>',[zhujiao]));
SendText.Add('<PseudoCode />');
SendText.Add('</DestUser_ID>');
SendText.Add('<Service_ID>');
SendText.Add('<ServiceIDType>1</ServiceIDType>');
SendText.Add(Format('<SPID>%s</SPID>',[spID]));
SendText.Add(Format('<SPServiceID>%s</SPServiceID>',[serverid]));
SendText.Add('<AccessNo />');
SendText.Add('</Service_ID>');
SendText.Add('<FeatureStr />');
SendText.Add('</SubscribeServiceReq>');
SendText.Add('</SOAP-ENV:Body>');
SendText.Add('</SOAP-ENV:Envelope>');
xhttp:= CreateOleObject('Microsoft.XMLHTTP');
xhttp.open('POST', 'http://211.139.9.181/dsmp/dsmp.wsdl', False);
xhttp.send(SendText.text);
hRet:=GetRetCode(xhttp.ResponseText,'<HRET>','</HRET>');
Result:=hRet;
Finally
SendText.Destroy;
end;
end;