POST /NotificationService HTTP/1.1 Host: www.xyz.com Content-Type: text/xml; charset="utf-8" Content-Length: nnnn SOAPAction: NotificationService#event <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:r="http://schemas.xmlsoap.org/rp" xmlns:n="http://www.xyz.com/notification.xsd"> <s:Header> <r:path> <r:to>smtp://technician@xyz.com</r:to> <r:id>cid:ticket12345</r:id> </r:path> </s:Header> <s:Body s:encodingStyle "http://schemas.xmlsoap.org/soap/encoding/"> <n:event> <source>Printer12</source> <description>DriveMotorFailure</description> </n:event> </s:Body> </s:Envelope> |
HTTP/1.1 200 OK Content-Type: text/xml; charset="utf-8" Content-Length: mmmm <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:n="http://www.xyz.com/notification.xsd"> <s:Body s:encodingStyle "http://schemas.xmlsoap.org/soap/encoding/"> <n:eventResponse> <status>OK</status> </n:eventResponse> </s:Body> </s:Envelope> |
struct Node { int val; int *ptr; struct Node *next; }; |
|
void soap_mark_Node(struct soap *soap, const struct Node *a) { soap_embedded(soap, &a->val, SOAP_TYPE_int); soap_embedded(soap, &a->ptr, SOAP_TYPE_PointerToint); soap_mark_PointerToint(soap, &a->ptr); soap_embedded(soap, &a->next, SOAP_TYPE_PointerToNode); soap_mark_PointerToNode(soap, &a->next); }; |
int soap_out_Node(struct soap *soap, const char *tag, int id, const struct Node *a, const char *type) { soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_Node), type); soap_out_int(soap, "val", -1, &a->val, ""); soap_out_PointerToint(soap, "ptr", -1, &a->ptr, ""); soap_out_PointerToNode(soap, "next", -1, &a->next, ""); soap_element_end_out(soap, tag); return SOAP_OK; } |
<Node id="_1"> <val>123</val> <ptr href="#_2"/> <next> <val id="_2">456</val> <ptr>789</ptr> <next href="#_1"/> </next> </Node> |
struct Node *soap_in_Node(struct soap *soap, const char *tag, struct Node *a, const char *type) { short soap_flag_val = 1, soap_flag_ptr = 1, soap_flag_next = 1; if (soap_element_begin_in(soap, tag)) return NULL; if (soap_match_tag(soap, soap->type, type)) { soap->error = SOAP_TYPE_MISMATCH; return NULL; } if (soap->null) return a; if (!*soap->href) { a = (struct Node *)soap_id_enter(soap, soap->id, a, SOAP_TYPE_Node, sizeof(struct Node), 0); if (!a) return NULL; if (soap->alloced) soap_default_Node(soap, a); if (soap->body) { for (;;) { soap->error = SOAP_TAG_MISMATCH; if (soap_flag_val && soap->error == SOAP_TAG_MISMATCH) if (soap_in_int(soap, "val", &a->val, "")) { soap_flag_val = 0; continue; } if (soap_flag_ptr && soap->error == SOAP_TAG_MISMATCH) if (soap_in_PointerToint(soap, "ptr", &a->ptr, "")) { soap_flag_ptr = 0; continue; } if (soap_flag_next && soap->error == SOAP_TAG_MISMATCH) if (soap_in_PointerToNode(soap, "next", &a->next, "")) { soap_flag_next = 0; continue; } if (soap->error == SOAP_TAG_MISMATCH) soap->error = soap_ignore_element(soap); if (soap->error == SOAP_NO_TAG) break; if (soap->error) return NULL; } if (soap_elemen_end_in(soap, tag)) return NULL; } } else { a = (struct Node *)soap_id_forward(soap, soap->href, (void**)soap_id_enter(soap, soap->id, a, SOAP_TYPE_Node, sizeof(struct Node), 0), SOAP_TYPE_Node, sizeof(struct Node)); if (soap->alloced) soap_default_Node(soap, a); if (soap->body && soap_element_end_in(soap, tag)) return NULL; } return a; } |
volatile struct tm { int tm_sec; /* seconds (0 - 60) */ int tm_min; /* minutes (0 - 59) */ int tm_hour; /* hours (0 - 23) */ int tm_mday; /* day of month (1 - 31) */ int tm_mon; /* month of year (0 - 11) */ int tm_year; /* year - 1900 */ int tm_wday; /* day of week (Sunday = 0) */ int tm_yday; /* day of year (0 - 365) */ int tm_isdst; /* is summer time in effect? */ char *tm_zone; /* abbreviation of timezone name */ long tm_gmtoff; /* offset from UTC in seconds */ }; |
<tm> <tm-sec>58</tm-sec> <tm-min>18</tm-min> <tm-hour>11</tm-hour> <tm-mday>18</tm-mday> <tm-mon>June</tm-mon> <tm-year>103</tm-year> <tm-wday>Wednesday</tm-wday> <tm-yday>168</tm-yday> <tm-isdst>DST</tm-isdst> <tm-zone>EDT</tm-zone> <tm-gmtoff>-14400</tm-gmtoff> </tm> |
Supported in part by NSF grants CCR-9904943, CCR-0105422, CCR-0208892, and DOE grant DEFG02-02ER25543.
2IBM's WSTKMD includes gSOAP and a Java component based on kSOAP.
3HTTP chunking appears to be asymmetric. For example, the Apache Web server returns HTTP chunked messages, yet it does not accept chunked messages.
4These measurements were taken from a stand-alone console-based Web services application that retrieves up-to-date stock quote information running on an Intel Pentium IIItm with Red Hat Linux 8.0 and compiled with gcc 3.2 option -O2