L
lijianzhou
Unregistered / Unconfirmed
GUEST, unregistred user!
下面是用vb.net做的函数,请问如何转成delphi,感谢!
Public Function FxQx(ByVal trid As String, ByVal dq As String, ByVal serverid As String, ByVal zhujiao As String, ByVal box As RichTextBox) As String
Try
Dim xxid As String
Randomize()
xxid = Trim(trid) + "00000" + Trim(Format(Int(Rnd() * 100000), "00000")
Dim xhttp As MSXML2.XMLHTTP
xhttp = CreateObject("Microsoft.XMLHTTP"
xhttp.open("POST", "http://11.11.11.11/dsmp/dsmp.wsdl", False)
Dim XmlBody As String = ""
XmlBody = XmlBody + "<?xml version=""1.0"" encoding=""UTF-8"" ?> " & vbCrLf
XmlBody = XmlBody + "<SOAP-ENV:Envelope xmlns:SOAP-ENV=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:SOAP-ENC=""http://schemas.xmlsoap.org/soap/encoding/"" 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/"">" & vbCrLf
XmlBody = XmlBody + "<SOAP-ENV:Header>" & vbCrLf
XmlBody = XmlBody + "<TransactionID xmlns=""http://www.monternet.com/dsmp/schemas/"" xsi:type=""xsd:string"">" & xxid & "</TransactionID> " & vbCrLf
XmlBody = XmlBody + "</SOAP-ENV:Header>" & vbCrLf
XmlBody = XmlBody + "<SOAP-ENV:Body>" & vbCrLf
XmlBody = XmlBody + "<UnSubscribeServiceReq xmlns=""http://www.monternet.com/dsmp/schemas/"">" & vbCrLf
XmlBody = XmlBody + "<Version>1.5.0</Version>" & vbCrLf
XmlBody = XmlBody + "<MsgType>UnSubscribeServiceReq</MsgType>" & vbCrLf
XmlBody = XmlBody + "<Send_Address>" & vbCrLf
XmlBody = XmlBody + "<DeviceType>400</DeviceType> " & vbCrLf
XmlBody = XmlBody + "<DeviceID>" & trid & "</DeviceID>" & vbCrLf
XmlBody = XmlBody + "</Send_Address>" & vbCrLf
XmlBody = XmlBody + "<Dest_Address>" & vbCrLf
XmlBody = XmlBody + "<DeviceType>0</DeviceType>" & vbCrLf
XmlBody = XmlBody + "<DeviceID>" & dq & "</DeviceID>" & vbCrLf
XmlBody = XmlBody + "</Dest_Address>" & vbCrLf
XmlBody = XmlBody + "<FeeUser_ID>" & vbCrLf
XmlBody = XmlBody + "<UserIDType>1</UserIDType>" & vbCrLf
XmlBody = XmlBody + "<MSISDN>" & zhujiao & "</MSISDN>" & vbCrLf
XmlBody = XmlBody + "<PseudoCode /> " & vbCrLf
XmlBody = XmlBody + "</FeeUser_ID>" & vbCrLf
XmlBody = XmlBody + "<DestUser_ID>" & vbCrLf
XmlBody = XmlBody + "<UserIDType>1</UserIDType>" & vbCrLf
XmlBody = XmlBody + "<MSISDN>" & zhujiao & "</MSISDN>" & vbCrLf
XmlBody = XmlBody + "<PseudoCode />" & vbCrLf
XmlBody = XmlBody + "</DestUser_ID>" & vbCrLf
XmlBody = XmlBody + "<Service_ID>" & vbCrLf
XmlBody = XmlBody + "<ServiceIDType>1</ServiceIDType>" & vbCrLf
XmlBody = XmlBody + "<SPID>" & trid & "</SPID>" & vbCrLf
XmlBody = XmlBody + "<SPServiceID>" & serverid & "</SPServiceID>" & vbCrLf
XmlBody = XmlBody + "<AccessNo />" & vbCrLf
XmlBody = XmlBody + "<FeatureStr />" & vbCrLf
XmlBody = XmlBody + "</Service_ID>" & vbCrLf
XmlBody = XmlBody + "</UnSubscribeServiceReq>" & vbCrLf
XmlBody = XmlBody + "</SOAP-ENV:Body>" & vbCrLf
XmlBody = XmlBody + "</SOAP-ENV:Envelope>"
xhttp.send(XmlBody)
XmlBody = Nothing
Dim MSTO As MSXML2.DOMDocument
MSTO = xhttp.responseXML
xhttp = Nothing
Dim S As String
S = MSTO.selectSingleNode("//hRet".text
MSTO = Nothing
Return S
Catch ex As Exception
Return 9
box.Text += zhujiao & "-" & serverid & "??,????:????,?????,?????????????!" + Chr(10)
End Try
End Function
Public Function FxQx(ByVal trid As String, ByVal dq As String, ByVal serverid As String, ByVal zhujiao As String, ByVal box As RichTextBox) As String
Try
Dim xxid As String
Randomize()
xxid = Trim(trid) + "00000" + Trim(Format(Int(Rnd() * 100000), "00000")
Dim xhttp As MSXML2.XMLHTTP
xhttp = CreateObject("Microsoft.XMLHTTP"
xhttp.open("POST", "http://11.11.11.11/dsmp/dsmp.wsdl", False)
Dim XmlBody As String = ""
XmlBody = XmlBody + "<?xml version=""1.0"" encoding=""UTF-8"" ?> " & vbCrLf
XmlBody = XmlBody + "<SOAP-ENV:Envelope xmlns:SOAP-ENV=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:SOAP-ENC=""http://schemas.xmlsoap.org/soap/encoding/"" 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/"">" & vbCrLf
XmlBody = XmlBody + "<SOAP-ENV:Header>" & vbCrLf
XmlBody = XmlBody + "<TransactionID xmlns=""http://www.monternet.com/dsmp/schemas/"" xsi:type=""xsd:string"">" & xxid & "</TransactionID> " & vbCrLf
XmlBody = XmlBody + "</SOAP-ENV:Header>" & vbCrLf
XmlBody = XmlBody + "<SOAP-ENV:Body>" & vbCrLf
XmlBody = XmlBody + "<UnSubscribeServiceReq xmlns=""http://www.monternet.com/dsmp/schemas/"">" & vbCrLf
XmlBody = XmlBody + "<Version>1.5.0</Version>" & vbCrLf
XmlBody = XmlBody + "<MsgType>UnSubscribeServiceReq</MsgType>" & vbCrLf
XmlBody = XmlBody + "<Send_Address>" & vbCrLf
XmlBody = XmlBody + "<DeviceType>400</DeviceType> " & vbCrLf
XmlBody = XmlBody + "<DeviceID>" & trid & "</DeviceID>" & vbCrLf
XmlBody = XmlBody + "</Send_Address>" & vbCrLf
XmlBody = XmlBody + "<Dest_Address>" & vbCrLf
XmlBody = XmlBody + "<DeviceType>0</DeviceType>" & vbCrLf
XmlBody = XmlBody + "<DeviceID>" & dq & "</DeviceID>" & vbCrLf
XmlBody = XmlBody + "</Dest_Address>" & vbCrLf
XmlBody = XmlBody + "<FeeUser_ID>" & vbCrLf
XmlBody = XmlBody + "<UserIDType>1</UserIDType>" & vbCrLf
XmlBody = XmlBody + "<MSISDN>" & zhujiao & "</MSISDN>" & vbCrLf
XmlBody = XmlBody + "<PseudoCode /> " & vbCrLf
XmlBody = XmlBody + "</FeeUser_ID>" & vbCrLf
XmlBody = XmlBody + "<DestUser_ID>" & vbCrLf
XmlBody = XmlBody + "<UserIDType>1</UserIDType>" & vbCrLf
XmlBody = XmlBody + "<MSISDN>" & zhujiao & "</MSISDN>" & vbCrLf
XmlBody = XmlBody + "<PseudoCode />" & vbCrLf
XmlBody = XmlBody + "</DestUser_ID>" & vbCrLf
XmlBody = XmlBody + "<Service_ID>" & vbCrLf
XmlBody = XmlBody + "<ServiceIDType>1</ServiceIDType>" & vbCrLf
XmlBody = XmlBody + "<SPID>" & trid & "</SPID>" & vbCrLf
XmlBody = XmlBody + "<SPServiceID>" & serverid & "</SPServiceID>" & vbCrLf
XmlBody = XmlBody + "<AccessNo />" & vbCrLf
XmlBody = XmlBody + "<FeatureStr />" & vbCrLf
XmlBody = XmlBody + "</Service_ID>" & vbCrLf
XmlBody = XmlBody + "</UnSubscribeServiceReq>" & vbCrLf
XmlBody = XmlBody + "</SOAP-ENV:Body>" & vbCrLf
XmlBody = XmlBody + "</SOAP-ENV:Envelope>"
xhttp.send(XmlBody)
XmlBody = Nothing
Dim MSTO As MSXML2.DOMDocument
MSTO = xhttp.responseXML
xhttp = Nothing
Dim S As String
S = MSTO.selectSingleNode("//hRet".text
MSTO = Nothing
Return S
Catch ex As Exception
Return 9
box.Text += zhujiao & "-" & serverid & "??,????:????,?????,?????????????!" + Chr(10)
End Try
End Function