' Preserve the local variable of the attribute value
Private Mvarserverurl As String ' Local Replication
Public Property Let Serverurl (byval vdata As String )
' Used to assign a value to a property, which is on the left of the value assignment statement.
' Syntax: X. serverurl = 5
Mvarserverurl = Vdata
End Property
Public Property Get Serverurl () As String
' Used to retrieve attribute values, on the right of the value assignment statement.
' Syntax: Debug. Print X. serverurl
Serverurl = Mvarserverurl
End Property
Public Function Executecommandwithreturn (byval command As String ) As String
Dim Safestring As String ' Authentication Code
Dim Strxml As String ' Soap Query
' Defines an xml http request object for sending requests
Dim Soaphttp As New MSXML. XMLHttpRequest
' Define an XML Document Object and convert the handwritten or accepted XML content into an XML object.
Dim Soapxml As New MSXML. domdocument
' Converts a handwritten soap string to an XML object.
Soapxml. loadxml strxml
' Sends a post message to a specified URL.
Soaphttp. Open " Post " , Mvarserverurl & "" , False
Soaphttp. setRequestHeader " Content-Type " , " Text/XML; charset = UTF-8 "
' Soaphttp. setRequestHeader "User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client protocol 1.1.4322.2300 )"
Soaphttp. setRequestHeader " Soapaction " , " Http://tempuri.org/GPSService/Data/ExecuteCommandWithReturn "
Soaphttp. Send (strxml)
While Soaphttp. readystate <> 4 ' Wait for processing to complete
Wend
' Returned XML Information
Dim Strreturn As String
' Debug. Print soaphttp. responsetext
Dim Xmlreturn As MSXML. domdocument
Set Xmlreturn = Soaphttp. responsexml
Executecommandwithreturn = Xmlreturn. childnodes ( 1 ). Text
Set Xmlreturn = Nothing
Set Soapxml = Nothing
Set Soaphttp = Nothing
Exit Function
Errs:
Msgbox Err. Description
Debug. Print err. Description
End Function
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.