Several functions are available for accessing SOAP headers. For details on accessing HTTP headers, see the initial four reference topics at the end of this topic.
The SOAP headers are accessible only to an EGL-generated, Java-based SOAP service or to an EGL-generated, Java- or JavaScript-based SOAP service requester.
Record SOAPHeader
field1 string{@xmlelement{namespace = "http://services";}};
field2 string{@xmlelement{namespace = "http://services";}};
end
The Record part must be non-structured, and each field must specify a namespace.
service SayHello
function hello()
getSOAPRequestHeaders(header);
//...
header SOAPHeader{field1="valueA", field2="valueB"};
ServiceLib.setSOAPResponseHeaders(header);
end
end
The function hello
retrieves the SOAP request
headers into a record of the type shown earlier, assigns values to
that record, and sets the SOAP response header with the requested
values.
srvc SayHello{@BindService {}};
header SOAPHeader{field1="value1", field2="value2"};
ServiceLib.setSOAPRequestHeaders(srvc, header);
response string = srvc.hello("ABC");
ServiceLib.getSOAPResponseHeaders(srvc, header);
The requester declares a service-access variable, assigns values to a record of the type shown earlier, sets the SOAP request header with those values, invokes the service, and retrieves the response headers into a record of the type shown earlier.