Class %SOAP.WebClient

abstract class %SOAP.WebClient extends %SOAP.WebBase

SOAP Web Client class.
Properties of this class that begin with Http are passed through to the %Net.HttpRequest instance used by the class.

Properties

• property HttpPassword As %String  [Transient;]
If the Username and Password are defined then this information will be send using Basic authentication to the web server. If you manually set the Authorization header this property will be ignored.
• property HttpProxyHTTPS As %Boolean  [Transient;]
If using a proxy server and this is true then it issues a request for an https page rather than the normal http page. This allows a proxy server that support https to support a secure connection from this %Net.Httprequest class.
• property HttpProxyPort As %String  [Transient;]
The port to connect to the proxy web server on. This is often port 8080 (the default).

You can specify a default proxy server for this namespace or for this Caché by setting ^SYS("HttpRequest","ProxyPort") or ^%SYS("HttpRequest","ProxyPort").

• property HttpProxyServer As %String  [Transient;]
If you need to make SOAP request through a proxy server you specify the proxy server host name in this property. If this property is defined then the http request will be directed at this machine and it will forward the request to the machine at Location and return the response.

You can specify a default proxy server for this namespace or for this Caché by setting ^SYS("HttpRequest","ProxyServer") or ^%SYS("HttpRequest","ProxyServer").

• property HttpRequestHeaderCharset As %String  [InitialExpression = "UTF-8"; Transient;]
The character set to send the HTTP request header in. According to the RFC the HTTP header should only contain ASCII characters as the behaviour with characters outside this range is unspecified. This class defaults to using UTF-8 as this leaves all the ASCII characters unchanged. You should never need to change this parameter.
• property HttpUsername As %String  [Transient;]
If the Username and Password are defined then this information will be send using Basic authentication to the web server. If you manually set the Authorization header this property will be ignored.

Methods

• method DoSOAPRequest(Client As %SOAP.WebClient, Action As %String, OneWay As %Boolean, requestStream As %BinaryStream, ByRef responseStream As %BinaryStream) returns %Status
Default transport for HTTP protocol %SOAP.WebClient acts as its own transport class. This method is used internally by Caché. You should not make direct use of it within your applications. There is no guarantee made about either the behavior or future operation of this method.
• method InvokeClient(proxy As %SOAP.ProxyDescriptor, MethodName As %String, Action As %String, OneWay As %Boolean = 0) returns nothing.
This method is used internally by Caché. You should not make direct use of it within your applications. There is no guarantee made about either the behavior or future operation of this method. Execute the Web Method represented by the descriptor class on the server. If an error is detected, a ztrap "SOAP" will be issued with %objlasterror containing the error %Status. If is the responsibilty of the caller of the proxy method to set an error trap and test for $ZE["<ZSOAP>". Note that if a SOAP fault is received, then the error is $$$SOAPFaultReceived. If MethodName argument is "", then this is an internal call to send the XML body. In this case proxy is the character stream containing the body. This method is used internally by Caché. You should not make direct use of it within your applications. There is no guarantee made about either the behavior or future operation of this method.
• method ResetHttpHeaders() returns %Status
Clear all previously set Http headers.
• method SetHttpHeader(name As %String, value As %String) returns %Status
Add a header to the http request. For example:
	Do httprequest.SetHeader("MyHeader","Data to display")
The header name is case insensitive and this class forces it to upper case so when the Http request is issued it will output the header as:

MYHEADER: Data to display

Note that headers such as Content-Type, Content-Encoding, and Content-Length are part of the entity body rather than the http main headers and as such as forwarded to the ContentType, ContentEncoding and trying to set the Content-Length is just ignored as this is a read only property. Also any attempt to set the 'Connection' header is ignored at this request class does not support persistent connections.

• method WSSecurityLogin(Username As %String, Password As %String) returns %Status
The WSSecurityLogin method adds the WS-Security Security header with /UsernameToken. Only the /UsernameToken/Username and /UsernameToken/Password fields are supported. Signing and/or encryption as specified by WS-Security is not supported. These facilities are expected to be implemented by the use of SSL.