SetWSObject

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.

Applies to

DataWindow type

Method applies to

PowerBuilder

DataWindow control, DataWindowChild object, DataStore object

Syntax

PowerBuilder

integer dwcontrol.SetWSObject ( wsconnection wsobject )

Argument

Description

dwcontrol

A reference to a DataWindow control, DataStore, or child DataWindow in which you want to use a programmer-specified Web service connection object

wsobject

The name of the connection object you want to use in the dwcontrol

Returns

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

Example 1

The following code instantiates a WSConnection object, then sets the object as the connection object for a Web service data source:

int ii_return

wsconnection ws_1

ws_1 = create wsconnection

ws_1.username = "johndoe"

ws_1.password = "mypassword"

ws_1.endpoint = "myendpoint"

ws_1.authenticationmode = "basic"

ws_1.usewindowsintegratedauthentication = true

ii_return = dw_1.setwsobject (ws_1)

See also