blob: 6f61daa3a9833392ff1375b70d80d4086c3888e7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
Overall design:
1. Use "interop" to get function declarations
2. Functions take parameters and return a "packet" object
(what to do with pointers? bundle all data into the packet?)
3. Packet object can be sent over the wire.
4. When you get a response packet, you can call another generated
function, to get the actual data.
import webservice;
interop ws = "ws" ("blabla.wsdl");
int main()
{
webservice:connection conn = ...;
// Low level way of sending a packet. Allows asynchronous sending.
webservice:packet pkt = ws:list_customers_by_name:build_packet("John");
webservice:response_packet respkt = webservice:send_packet(conn, pkt); // could be asynchrounous, and you could also send multiple "webservice:packet"s in one physical packet (pipelining)
ws:person p1 = ws:list_customers_by_name:extract_result(respkt);
// (own qualifiers? of both the packet and the person object)
// Synchrounous high-level way of sending a packet
ws:person p2 = ws:list_customers_by_name(conn, "John");
// Asynchrounous high-level way of sending a packet
webservice:future[ws:person] = ws:list_customers_by_name:send_async(conn, "John");
// TODO think about this
return 0;
}
|