Hallo forum,
Ben aan het experimenteren met SOAP webservices vanuit Excel2007.
Hieronder code welke ik vond op internet waarbij Button3 een "Hello" webservice beschikbaar op het internet succcesvol aanroept.
Met Button4 probeer ik een webservice op een lokaal IP adres aan te roepen. Ik probeer een machine gekoppeld aan dit IP adres te resetten.
Hiebij krijg echter steeds de reply dat de "endpoint" niet correct is.
Wat doe ik fout?
Hoe moet ik de webservice http://192.168.0.25/axis2/services/BrueBoxService en de functie /ResetRequest in deze code wel correct aanroepen?
Bij voorbaat dank voor alle hulp!
Burst
Ben aan het experimenteren met SOAP webservices vanuit Excel2007.
Hieronder code welke ik vond op internet waarbij Button3 een "Hello" webservice beschikbaar op het internet succcesvol aanroept.
Met Button4 probeer ik een webservice op een lokaal IP adres aan te roepen. Ik probeer een machine gekoppeld aan dit IP adres te resetten.
Hiebij krijg echter steeds de reply dat de "endpoint" niet correct is.
Wat doe ik fout?
Hoe moet ik de webservice http://192.168.0.25/axis2/services/BrueBoxService en de functie /ResetRequest in deze code wel correct aanroepen?
Bij voorbaat dank voor alle hulp!
Burst
Code:
Private Sub CommandButton3_Click()
Rem [url]http://www.herongyang.com/Service/Hello_SOAP_11.php[/url]
Dim sEnv As String
Dim xmlhtp As New MSXML2.XMLHTTP
Dim xmlDoc As New DOMDocument
sURL = "http://www.herongyang.com/Service/Hello_SOAP_11.php"
sEnv = "<?xml version=""1.0"" encoding=""utf-8""?>"
sEnv = sEnv & "<soap:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"">"
sEnv = sEnv & " <soap:Body>"
sEnv = sEnv & " <ser:HelloRequest>/?</ser:HelloRequest>"
sEnv = sEnv & " </soap:Body>"
sEnv = sEnv & "</soap:Envelope>"
MsgBox ("SOAP Request is : " & vbCr & (sEnv))
With xmlhtp
.Open "post", sURL, False
.setRequestHeader "Host", "www.herongyangcom"
.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
.setRequestHeader "soapAction", "http://www.herongyang.com/Service/Hello_SOAP_11.php"
.setRequestHeader "Accept-encoding", "zip"
.send sEnv
xmlDoc.LoadXML .responseText
'xmlDoc.Save ThisWorkbook.Path & "\WebQueryResult.xml"
MsgBox .responseText
End With
End Sub
Private Sub CommandButton4_Click()
Rem sURL = "http://192.168.0.25/axis2/services/BrueBoxService/ResetRequest"
Dim sEnv As String
Dim xmlhtp As New MSXML2.XMLHTTP
Dim xmlDoc As New DOMDocument
sURL = "http://192.168.0.25/axis2/services/BrueBoxService/ResetRequest"
sEnv = ""
sEnv = sEnv & "<s:Envelope xmlns:s=""http://schemas.xmlsoap.org/soap/envelope/""><s:Body xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema""><ResetRequest xmlns=""http://www.glory.co.jp/bruebox.xsd""><Id>30-6-2017 15:52:58</Id><SeqNo>12345678</SeqNo></ResetRequest></s:Body></s:Envelope> "
MsgBox ("SOAP Request is : " & vbCr & (sEnv))
With xmlhtp
.Open "post", sURL, False
.setRequestHeader "Host", "http://192.168.0.25"
.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
.setRequestHeader "soapAction", "http://192.168.0.25/axis2/services/BrueBoxService/ResetRequest"
.setRequestHeader "Accept-encoding", "zip"
.send sEnv
xmlDoc.LoadXML .responseText
'xmlDoc.Save ThisWorkbook.Path & "\WebQueryResult.xml"
MsgBox .responseText
End With
End Sub
Laatst bewerkt door een moderator: