Skip to main content

Customizing Callbacks of a Web Client

You can customize the behavior of an InterSystems IRIS® data platform web client by overriding its callback methods:

%OnSOAPRequest()
Method %OnSOAPRequest(mode As %String, 
                      client As %SOAP.WebClient,  
                      action As %String,  
                      oneWay As %Boolean,  
                      method As %String,  
                      requestStream As %BinaryStream)

Called just before the web client invokes the DoSOAPRequest() method of the transport class (which makes the actual SOAP request). The default DoSOAPRequest() method is included in %SOAP.WebClient and uses HTTP for request/response.

  • mode specifies the type of SOAP request ("SOAP" or "binary").

  • client is the OREF of the web client instance.

  • action contains the value of the SOAPAction header.

  • oneWay is true if no body is to be sent.

  • method argument is the name of the web method that is being invoked.

  • requestStream argument contains the SOAP request message in a stream.

%OnSOAPResponse()
Method %OnSOAPResponse(mode As %String, 
                       client As %SOAP.WebClient, 
                       action As %String, 
                       oneWay As %Boolean, 
                       method As %String, 
                       requestStream As %BinaryStream, 
                       responseStream As %BinaryStream, 
                       sc As %Status)

Called after the web client has invoked the DoSOAPRequest() method of the transport class. The sc argument is the status returned by the DoSOAPRequest() method of the transport class. The other arguments are the same as for %OnSOAPRequest().

%OnSOAPFinished()
Method %OnSOAPFinished(mode As %String, client As %SOAP.WebClient, method As %String, sc As %Status)

Called after the web client has performed all its processing. The sc argument is the status returned by the web method that was invoked. The mode, client, and method arguments are the same as for the other callback methods.

FeedbackOpens in a new tab