Optimisation of SOAP Requests - Using Stored Procedures

Cadcorp GeognoSIS runs as a Web Service; it allows client applications to contact it using SOAP messages. (eg ASP.NET web pages or Visual Basic applications).

But communication stress happens with each use of the Cadcorp GeognoSIS API:

  1. Packaging up arguments into an XML document
  2. Transporting it to Cadcorp GeognoSIS
  3. Unpacking
  4. Then doing the same in reverse with whatever Cadcorp GeognoSIS returns.

For eg, consider the following simple fragment of code:

Dim allNames as String = ""
Dim nItems as Integer = sis.Scan("items", myOverlay, "", "")
For I = 0 to nItems 
  Dim name = sis.GetListItemStr("items", "_name$") 
  allNames = allNames & "," & name
Next

If the scan finds 100 items, a total of 101 messages will be sent– this is costly when the client runs on the same server as Cadcorp GeognoSIS but potentially disastrous when the two are communicating over a busy network.

How can stored procedures help?

With this option, you simply create your own API methods for GeognoSIS and bundle a large amount of work into a single procedure.

The code shown above can become just such a procedure. Although Cadcorp GeognoSIS has the same amount of work to do, the number of messages between client and Cadcorp GeognoSIS is reduced to just one.

This also means other client applications can use the same enhancements making them more reliable and maintainable.

Note on Cadcorp GeognoSIS communication speed with client

In GeognoSIS 9, communication speed has been significantly improved compared to older versions.

A .asmx service also uses wrapped Document/literal SOAP messages.

The SOAP style is selected by the new 'type' parameter added to GeognoSIS.wsdl.

When a web reference is added to a VS project, the service URL can be specified in the following ways:

http://localhost:4326/GeognoSIS/GeognoSIS.wsdl
http://localhost:4326/GeognoSIS/GeognoSIS.wsdl?type=RpcEncoded
http://localhost:4326/GeognoSIS/GeognoSIS.wsdl?type=DocumentLiteral

If the type argument is missing DocumentLiteral will be used by default.