1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| Dim http As New MSXML2.XMLHTTP
Dim serviceUrl As String = "http://localhost/nusoap/hello-service.php"
Dim msg As String = "<?xml version=""1.0"" encoding=""ISO-8859-1""?>"
msg = "<SOAP-ENV:Envelope SOAP-ENV:encodingStyle=""http://schemas.xmlsoap.org/soap/encoding/"">" & Chr(13)
msg &= "<SOAP-ENV:Body>" & Chr(13)
msg &= "<bonjour>" & Chr(13)
msg &= "<prenom>" & prenom & "</prenom>" & Chr(13)
msg &= "</bonjour>" & Chr(13)
msg &= "</SOAP-ENV:Body>" & Chr(13)
msg &= "</SOAP-ENV:Envelope>" & Chr(13)
http.open("POST", serviceUrl, False)
http.setRequestHeader("Content-Type", "text/xml; charset=ISO-8859-1")
http.setRequestHeader("SOAPAction", """""")
http.send(msg)
Dim table_tmpTxt As New ArrayList
Dim MaRegExpMatch As System.Text.RegularExpressions.MatchCollection
MaRegExpMatch = Regex.Matches(http.responseText, "(<return xsi:type=""xsd tring"">)(.*)(</return>)", RegexOptions.IgnoreCase)
Dim i As Integer
For i = 0 To MaRegExpMatch.Count - 1
table_tmpTxt.Add(Regex.Replace(MaRegExpMatch .Value.Trim.Replace("""""", """"), "<return xsi:type=""xsd tring"">", ""))
table_tmpTxt = Regex.Replace(table_tmpTxt , "</return>", "")
Next
Return table_tmpTxt |