Internet access and access to different protocols and date formats from ClassiX® can be realized with several COM objects. These are introduced as follows:
Official
Microsoft
Documentation
The Windows WinHTTP interface provides access to the HTTP protocol. It can be used to download files from the internet (e.g. to update data) or generally to use any kind of web page. It is quite simple:
This generates the COM object and initializes it as WinHTTP.
To open the address, it gets passed to WinHTTP. The first parameter ("GET") controls, which kind of HTTP request to use (GET or POST). After, the address follows and the last parameter specifies, whether the call should be asynchronous or not. Here, FALSE should always be passed and the synchronous call should be used. Calling 'Send', the actual request gets sent. The send method only returns in the synchronous mode, if the request result is clear. In the asynchronous case it continues straight away, meaning it is not clear, whether data is already available or not. Therefore, as described above, the synchronous mode should be used.
A status query can check, whether the HTTP request had been successful. Here, the HTTP status codes, which have been specified in RFC 2616 are returned. The result can be taken back as a string and subsequently processed with the method GetResponseText.
Official documentation in the
OpenWDDX.org
SDK
WDDX is an XML-based data format to simplify data exchange especially between web applications. There are diverse web applications on the internet, providing a WDDX interface to provide their functionality. Requests for web application are usually sent as normal HTTP requests, and the answer will be a WDDX-coded data stream. To use such web applications in ClassiX®, the WDDX interface can be used via discretionary COM object. The actual communication on HTTP level can be done via WinHTTP interface, as described above.
Here, the COM object will be generated and initialized as WDDX deserializer.
Here, an answer gets taken from an already processed query. Afterwards, it will be converted via WDDX interface into an answer, which is easy to process.
It is possible to access single data fields via answer object method. Their names depend on the equivalent web application and should be described in the application documentation.