2. HTTP
Prev | Chapter 7. SOAP and SRU | Next

## 2. HTTP

YAZ only offers HTTP as transport carrier for SOAP, but it is relatively easy to change that.

The following definition of `Z_GDU` (Generic Data Unit) allows for both HTTP and Z39.50 in one packet.

    #include <yaz/zgdu.h>

    #define Z_GDU_Z3950         1
    #define Z_GDU_HTTP_Request  2
    #define Z_GDU_HTTP_Response 3
    typedef struct {
      int which;
      union {
        Z_APDU *z3950;
        Z_HTTP_Request *HTTP_Request;
        Z_HTTP_Response *HTTP_Response;
      } u;
    } Z_GDU ;

The corresponding Z_GDU encoder/decoder is `z_GDU`. The `z3950` is any of the known BER encoded Z39.50 APDUs. `HTTP_Request` and `HTTP_Response` is the HTTP Request and Response respectively.

Prev | Up | Next
Chapter 7. SOAP and SRU | Home | 3. SOAP Packages