REST Service Classes

The generated REST client NVO uses the PowerBuilder RestService class and several supporting classes.

WebConnection Class

The WebConnection class enables you to customize request properties. You can use it to set the endpoint URI, message format, and client credential.

Property or Method Return Type Read/Write Description
Endpoint String RW Gets and sets the method URI. Default: null.
RequestMessageFormat WebMessageFormat (enum) RW Gets and sets one of these request message formats:
  • XML (default)
  • JSON
  • DataContract
ResponseMessageFormat WebMessageFormat (enum) RW Gets and sets one of these request message formats:
  • XML (default)
  • JSON
  • DataContract
ClientCredential WebClientCredential RW Gets and set the client credential items (for example, security mode, user name, and password).
ProxyServer WebProxyServer (class) RW Gets and sets the client firewall.
MaxMessageLength System.UInt32 (ulong in PowerScript) RW Gets and set the maximum length of the message, in bytes. Default: 262144 (256 KB)

WebMessageFormat enum

The WebMessageFormat enum allows three formats for the message body:

WebClientCredential Class

This class specifies properties for REST service client credentials. When called, the PowerBuilder REST client uses credentials to communicate to the service. It supports all transport-level authentications, including Windows authentication, Basic, Digest, and certificate authentication.

Property or Method Return Type Read/Write Description
AccessAuthentication AuthenticationMode (enum) RW Gets and sets one of these authentication modes:
  • Anonymous (default)
  • Basic
  • Digest
Domain String RW Gets and sets the domain that the user is based on. Ignored when AccessAuthentication is set to Anonymous.
Username String RW Gets and sets the user name. Ignored when AccessAuthentication is set to Anonymous.
Password String RW Gets and sets the password. Ignored when AccessAuthentication is set to Anonymous.
UseIntegratedWindowsAuthentication Boolean RW Get and sets using Integrated Windows authentication.
Certificate WebClientCertificate (class) RW Gets and sets the client certificate.

WebClientCertificate Class

This class specifies a certificate from a certificate store or a certificate file. When called, the REST client exchanges the certificate with the server for authentication.

Property or Method Return Type Read/Write Description
StoreName CertStoreName (enum) RW Gets and sets the certificate store name, using one of:
  • AddressBook
  • AuthRoot
  • CertificateAuthority
  • Disallowed
  • My (default)
  • Root
  • TrustedPeople
  • TrustedPublisher
StoreLocation CertStoreLocation (enum) RW Gets and sets the certificate location, using one of:
  • CurrentUser (default)
  • LocalMachine
FindType CertFindType (enum) RW Specifies how to find the certificate in the cert store, using one of:
  • FindByThumbprint
  • FindBySubjectName (default)
  • FindBySubjectDistinguishedName
  • FindByIssuerName
  • FindByIssuerDistinguishedName
  • FindBySerialNumber
  • FindByTimeValid
  • FindByTimeNotYetValid
  • FindByTimeExpired
  • FindByTemplateName
  • FindByApplicationPolicy
  • FindByCertificatePolicy
  • FindByExtension
  • FindByKeyUsage
  • FindBySubjectKeyIdentifier
FindValue string RW Specify the value to find.
CertFileName string RW Specify one or more certificate files, using a semicolon-separated list.

WebProxyServer

This class specifies properties for a client firewall. When called, the REST client communicates with the server through the firewall.

Property or Method Return Type Read/Write Description
Address string RW Gets and sets the URL of the firewall. Default: null.

Example: http://www.x12345.com :8000

BypassProxyOnLocal bool RW Specifies whether the client uses the proxy server when the services are on the local machine.
  • False (default): all Internet requests are made through the proxy server.
  • True: local Internet resources do not use the proxy server.

Local requests are identified by the absence of a period in the URI (for example, http://webserver/), or by a URI that explicitly addresses a local resource (for example, http://localhost, http://loopback, or http://127.0.0.1).

UseDefaultCredentials bool RW Specifies how the server authenticates proxy requests for access.
  • False (default): does not require the user to provide credentials. Instead, uses the value set in the Credential property for authentication.
  • True: requires the server to authenticate requests using credentials provided by the user. Ignores the Credential property setting.
Credential WebProxyCredential (class) RW Gets or sets the credentials to submit to the proxy server for authentication. The Credential property contains the authentication credential to send to the proxy server. Default: null.

WebProxyCredential

This class specifies the credential of the proxy server. When called, the REST client uses the credential to communicate with the server.

Property or Method Return Type Read/Write Description
Domain string RW Gets and sets the user's domain.
Username string RW Gets and sets the user name.
Password string RW Gets and sets the password.