SetWSObject method (DataWindows)
Description
Causes a DataWindow control or DataStore to use a programmer-specified Web
service connection object. The connection object provides the information
necessary for communicating with a Web service data source.
Controls
DataWindow type |
Method applies to |
---|---|
PowerBuilder |
DataWindow control, DataWindowChild object, DataStore |
Syntax
[PowerBuilder]
1 |
integer <span>dwcontrol</span>.<span>SetWSObject</span> ( wsconnection <span>wsobject </span>) |
Argument |
Description |
---|---|
dwcontrol |
A reference to a DataWindow control, |
wsobject |
The name of the connection object you |
Return Values
Returns 1 if it succeeds and –1 if an error occurs.
If the WSConnection object is null, in PowerBuilder the method returns
null.
Usage
You call the SetWSObject method to pass
an instance of the WSConnection object and connect to a Web service
data source.when the Web service requires user–related,
session-related, or authentication information. If the Web service
does not require this information, you do not need to use the WSConnection
object (or call SetWSObject) to access Web service
data.
Examples
The following code instantiates a WSConnection object,
then sets the object as the connection object for a Web service
data source:
1 |
int ii_return |
1 |
wsconnection ws_1 |
1 |
ws_1 = create wsconnection |
1 |
ws_1.username = "johndoe" |
1 |
ws_1.password = "mypassword" |
1 |
ws_1.endpoint = "myendpoint" |
1 |
ws_1.authenticationmode = "basic" |
1 |
ws_1.usewindowsintegratedauthentication = true |
1 |
ii_return = dw_1.setwsobject (ws_1) |