Home > Software engineering >  VB accessed through SOAP webservices
VB accessed through SOAP webservices

Time:09-25

Affixed first I put the code, IP address of the company I give to the XX, I looked as if there is no problem, I don't know where is wrong, the last is the wrong bad request, I put the wrong prompt also labeled,
Thank you pray god to help see, 100,,

 Dim soap As New SoapClient30 
Private Sub Command1_Click ()
Dim strtest As String
Strtest="& lt; ? XML version="1.0" "encoding=" utf-8 ""?> "
Strtest=strtest + "& lt; The 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/" "& gt; "
Strtest=strtest + "& lt; soap:Body> "
Strtest=strtest + "& lt; CheckInNotify xmlns=http://tempuri.org/"" & gt; "
Strtest=strtest + "& lt; RoomNo> 601 & lt;/RoomNo> "
Strtest=strtest + "& lt; Floor> 6 "
Strtest=strtest + "& lt; GuestName> Test0520 & lt;/GuestName> "
Strtest=strtest + "& lt; GuestID> 111111111111111 & lt;/GuestID> "
Strtest=strtest + "& lt; Gender> Male "
Strtest=strtest + "& lt; GuestAccount> Test0520 & lt;/GuestAccount> "
Strtest=strtest + "& lt; Nationality> China & lt;/Nationality> "
Strtest=strtest + "& lt; GroupNo> 001 & lt;/GroupNo> "
Strtest=strtest + "& lt; GroupName> Test "
Strtest=strtest + "& lt; TurnOnVOD> True "
Strtest=strtest + "& lt; PhoneNumber> 11111111 & lt;/PhoneNumber> "
Strtest=strtest + "& lt; Address> 111 & lt;/Address> "
Strtest=strtest + "& lt; RoomMates> False "
Strtest=strtest + "& lt;/CheckInNotify> "
Strtest=strtest + "& lt;/soap: Body> "
Strtest=strtest + "& lt;/soap: Envelope> "
STRXML=strtest
'objects, define a HTTP post messages sent to the server side
Dim h As MSXML2. ServerXMLHTTP40
'definition of an XML document object, will be handwritten or accept the XML content into XML object
Dim x As MSXML2. DOMDocument40
'initialize the XML object
The Set x=New MSXML2. DOMDocument40
'will hand SOAP string converted to XML object
X.l oadXML STRXML
'initialize HTTP objects
The Set h=New MSXML2. ServerXMLHTTP40
'Post messages sent to the specified URL, the web service address for reference of
H.o pen "POST", "http://XXX.XX.XXX.XXX:XXXX/ws/vodws.php? WSDL, "False
H.s etRequestHeader "content-type", "text/XML"
H.s etRequestHeader "SOAPAction", "http://XXX.XX.XXX.XXX:XXX/ws/vodws.php? WSDL
"H.s end (STRXML)
While practice eadyState & lt;> 4
Wend
'according to the returned XML information
Dim the text As String
Text=practice esponseText
MsgBox text
End Sub

Private Sub Form_Load ()

On the Error Resume Next

Soap. ClientProperty (" ServerHTTPRequest ")=True
Call soap. Mssoapinit (" http://XXX.XX.XXX.XXX:XXXX/ws/vodws.php? WSDL ")
If Err & lt;> 0 Then
MsgBox "initialization SOAP failure" + Err. The Description
The Else
MsgBox "initial success"
End the If
End Sub
  • Related