SOAP
SO-S-11 SOAP & WSDL service
Global provinces and administrative divisions lookup service
Example overview
This example demonstrates:
- Fetching HTML from a foreign host to populate a native table.
- A SOAP call.
- SQL to XML conversion with FOR XML EXPLICIT.
- XSL transformation.
Example Setup
The service is prepared by loading the SQL file. This performs the following:
- Fetch HTML country and province data from a foreign host.
- Insert the data into COUNTRY and PROVINCE tables.
- Fill tables COUNTRY_XML and PROVINCE_XML using http://[host:port]/DAV/factbook/factbook.xml. (http://www.xfront.org/factbook.xml)
- Define a stored procedure for the SOAP service that queries, using SQL, the data from the tables. The data is returned as XML, by including the FOR XML EXPLICIT clause, using the xml_auto() function to produce this as a string.
-
Sample can use data from:
- Live feed from CIA factbook
- Cached XML Data
- The SOAP service is achieved by defining the /SOAP_SO_S_11 URL to have same functionality as using soap_server() function call.
Example Operation
- Makes a SOAP client request. The XML result is held in a stream.
- Convert the stream using XSLT to HTML.
- Send the HTML to the browser for display.
Invoking the operation via VB.NET application
The following example demonstrates the usage of the Microsoft .NET against Virtuoso's SOAP service as defined in 'Server Setup':
1. Open a new VB.NET project for Console Application.
2. Add a web reference to the Virtuoso WSDL end point (http://[host:port]/SOAP_SO_S_11/services.wsdl).
3. Drag and drop the VirtuosoSOAP() from Class wizard in routine code.
Sub Main()
Dim soap As New WebReference1.VirtuosoSOAP()
Dim result As String
Dim sty As New Xml.Xsl.XslTransform()
result = soap.administrative_divisions("United States", "")
sty.Load("http://[host:port]/tutorial/services/so_s_11/sr.xsl")
Dim strReader As New IO.StringReader(result)
Dim xpDoc As New Xml.XPath.XPathDocument(strReader)
Dim arg As New Xml.Xsl.XsltArgumentList()
Dim strWriter As New IO.StringWriter()
sty.Transform(xpDoc.CreateNavigator(), arg, strWriter)
System.Console.WriteLine(strWriter.ToString)
End Sub
Warning: WebDAV VSP Page Execution is currently disabled. Please enable in order to use this service. Go to the Config file for the demo database (the file "demo.ini") and edit the section-key: EnabledDavVSP = 0 by uncommenting and then changing the 0 to 1.
| View the source | Action |
|---|---|
| 1. so_s_11.sql | Set the initial state |
| 2. array2d.xsd | |
| 3. array_div.xsd | |
| 4. division.xsd | |
| 5. factbook.xml | |
| 6. moz.xsl | |
| 7. provinces.xsd | |
| 8. provinces_ajax.html | Run |
| 9. raw.xsl | |
| 10. so_s_11_array_client.vsp | Run |
| 11. so_s_11_client.vsp | Run |
| 12. sr.xsl | |
| 13. sr2d.xsl |
OpenLink Home
Technical Support