Webservice is called in VB6 or ASP.
Web Services enables data sharing and communication between heterogeneous computing environments to achieve information consistency. We can use
Http post/GET and SOAP protocols are used to call Web Services.
1. Use the SOAP protocol to call Web Services in VB6
First, use. net to publish a simple Web Services.
<WebMethod ()> _
Public Function getString (ByVal str As String) As String
Return "Hello World," & str &"! "
End Function
This Web Service only contains one getString method, which is used to return a string. When we call this Web Services, the SOAP message sent to the. asmx page is:
<? Xml version = "1.0" encoding = "UTF-8"?>
<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/ ">
<Soap: Body>
<GetString xmlns = "http://tempuri.org/TestWebService/Service1">
<Str> string </str>
</GetString>
</Soap: Body>
</Soap: Envelope>
The returned SOAP message is:
<? Xml version = "1.0" encoding = "UTF-8"?>
<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/>
<Soap: Body>
<GetStringResponse xmlns = "http://tempuri.org/TestWebService/Service1">
<GetStringResult> string </getStringResult>