The generated REST client NVO uses the PowerBuilder RestService class and several supporting classes.
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:
|
ResponseMessageFormat | WebMessageFormat (enum) | RW | Gets and sets one of these request message
formats:
|
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) |
The WebMessageFormat enum allows three formats for the message body:
String Example:
<string>You have entered (Xml, Bare): 12345</string>
Int Array Example:
<ArrayOfint> <int>0</int> <int>1</int> <int>2</int> </ArrayOfint>
Structure Example:
<myStruct> <i1>10</i1> <str1>Xml, Bare</str1> </myStruct>
String Example:
<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/"> You have entered (Xml, Bare): 12345 </string>
Int Array Example:
<ArrayOfint xmlns="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <int>0</int> <int>1</int> <int>2</int> </ArrayOfint>
Structure Example:
<myStruct xmlns="http://schemas.datacontract.org/2004/07/None" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <i1>10</i1> <str1>Xml, Bare</str1> </myStruct>
String Example:
"You have entered (Json, Bare): 12345"
Int Array Example:
[0,1,2]
Structure Example:
{"i1":30,"str1":"Json, Bare"}
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:
|
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. |
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:
|
StoreLocation | CertStoreLocation (enum) | RW | Gets and sets the certificate location, using one of:
|
FindType | CertFindType (enum) | RW | Specifies how to find the certificate in the cert
store, using one of:
|
FindValue | string | RW | Specify the value to find. |
CertFileName | string | RW | Specify one or more certificate files, using a semicolon-separated list. |
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.
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.
|
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. |
This class specifies the credential of the proxy server. When called, the REST client uses the credential to communicate with the server.