Method descriptions


RemoveAuthentication

Description

Removes authentication for a Web service connection. This method is available for .NET Web services only.

Syntax

conn.RemoveAuthentication ()

Argument

Description

conn

The name of the SoapConnection object that establishes the connection

Return values

Long. Valid values are 0 for success, and 50 for failure.

Usage

This method clears Basic, Digest, and Integrated Windows Authentication information. You can set authentication with the SetBasicAuthentication, UseIntegratedWindowsAuthentication, or SetOptions methods.

See also


SetBasicAuthentication

Description

Determines whether the SoapConnection object uses basic authentication for a Web service connection. This method is available for .NET Web services only.

Syntax

conn.SetBasicAuthentication (string domain, string userID, string password)

Argument

Description

conn

The name of the SoapConnection object that establishes the connection.

domain

A string for the Web domain to which the user belongs. This could be a domain name, such as “sybase.com”, or a machine name.

userID

A string for an https connection.

password

A string for an https connection.

Return values

Long. Valid values are 0 for success, and 50 for failure.

Usage

You can call the SetBasicAuthentication method instead of including client identification information in the options argument of the SetOptions method. For Integrated Windows Authentication, you can call the UseIntegratedWindowsAuthentication method.

See also


SetClientCertificateFile

Description

Sets the certificate file or files to use to connect to a Web service. This method is available for .NET Web services only.

Syntax

conn.SetClientCertificateFile (string filename)

Argument

Description

conn

The name of the SoapConnection object that establishes the connection.

filename

A string containing the name of the certificate file or files you want to use to connect to a Web service. You must use a semicolon as a separator for multiple files. The value can include local files with a full path and URLs to remote certificate files. To discontinue use of certificates, enter an empty string (“”).

Return values

Long. Valid values are 0 for success, and 50 for failure.

Usage

You can call the SetClientCertificateFile method instead of including certificate information in the options argument of the SetOptions method.

See also


SetOptions

Description

Sets connection options for SoapConnection class. The string values for the option names are not case sensitive. Although the SetOptions method takes a single string argument for all available options, you can set each of the options with more specific methods.

For .NET Web services, you can use the following methods to replace the SetOptions method:

For EasySoap Web services, you can use the following methods to replace the SetOptions method:

Syntax

conn.SetOptions (string options)

Argument

Description

conn

The name of the SoapConnection object that establishes the connection.

options

Options you want to set for your connection. These can be:

  • SoapLog (EasySoap Web service engine only) The file path for SoapLog. To disable the log, enter "".

  • UserID A string value for an https connection.

  • Password A string value for an https connection.

  • Domain (.NET Web service engine only) A string value for the Web domain to which the user belongs. This could be a domain name, such as “sybase.com”, or a machine name.

  • UseWindowsAuthentication (.NET Web service engine only) A “yes” or “no” value to determine whether to use “Integrated Windows Authentication.” The value you enter can be a boolean or a string. If this option is set to “yes,” you do not need to set the UserID, Password, or Domain options.

  • AuthenticationMode (.NET Web service engine only) A string value for the authentication mode you want to use. This can be “basic” or “digest”. AuthenticationMode values are described on the Microsoft MSDN Web site.

  • CertificateFile (.NET Web service engine only) A string value for the certificate file or files that you want to send from the Web service client to the server. The string value could include local files with a full path and URLs to remote certificate files. You must use a semicolon as a separator for multiple files.

  • Timeout A number for the maximum wait time in seconds.

    The default timeout value is 0, meaning that no limit to the connection time is set.

  • ConnectionCache (EasySoap Web service engine only) A boolean that determines whether the http connection of the proxy instance is kept alive after a call to the proxy. The default value is false. For Web services on EAServer, you must not change the default.

Return values

Long. Valid values are 0 for success, and 50 for failure. If multiple options are specified and the return value is 50, options specified before the failure are still valid.

Examples

Example 1

In this example, the application enables the logging function and attempts to connect to an endpoint for which no user ID, password, or timeout has been set.

lOpt=Conn.SetOptions("SoapLog=~"airportweather.log~"")

If you do not want to use escape characters before a second pair of quotation marks, you can use single quotation marks instead, or you can start an exterior string with single quotation marks and use double quotation marks around an interior string:

lOpt=Conn.SetOptions('SoapLog="airportweather.log"')

Usage

User ID and password values can be set in an endpoint used by the SoapConnection class or by including these values as arguments to the SetOptions method.

Priority is given to values set in an endpoint (port) that is passed as an argument to the CreateInstance method of the SoapConnection class. However, a default endpoint is used when an endpoint is not set in the CreateInstance method. In this case, priority is given to user ID and password values defined in the SetOptions method.

If the endpoint used by the SoapConnection class does not have user ID and password values, and you do not set a user ID or password with the SetOptions method, the SoapConnection class connects to a SOAP server without giving a user ID or password.

If a user ID is defined in either the endpoint or the SetOptions method but is not a password, the password value is taken to be an empty string.

When you set a timeout other than the default, an exception is thrown after the Web service connection times out. Even if you do not set a timeout value from the client, the Web server can still cause the request to time out on the server side.

If you include ConnectionCache as an argument in a SetOptions call, you must not use quotation marks to enclose the value that you set for this option.

See also


SetProxyServer

Description

Sets the address, port, user name, and password for the proxy server. This method has two syntaxes.

Syntax

conn.SetProxyServer (string address, string userID, string password)
conn.SetProxyServer (string hostname, long port, string userID, string password)

Argument

Description

conn

The name of the SoapConnection object that establishes the connection

address

A string containing the host name address and port of the proxy server, and optionally, an endpoint— in the format:

http://hostname:port/path

hostname

A string containing the host name

port

A long for the proxy server port

userID

A string containing the user ID for the proxy server

password

A string containing the proxy server password

Return values

Long. Valid values are 0 for success, and 50 for failure.

Examples

Example 2

This example uses the four-argument syntax of SetProxyServer:

long ll_return
ll_return = Conn.SetProxyServer &
 (“http://myProxyServer”,8080, “My Name”, “My Pass”)

Usage

This method does the same thing as the SetProxyServerOptions method, but it has a different syntax.

Use this method or the SetProxyServerOptions method if the proxy server requires authentication. The user ID and password that you supply with the SetOptions or other authentication methods apply to the URL of the Web service, not the proxy server.

See also


SetProxyServerOptions

Description

Sets the proxy address, user name, and password for the proxy server.

Syntax

conn.SetProxyServerOptions (string optionstring)

Argument

Description

conn

The name of the SoapConnection object that establishes the connection.

optionstring

A string containing comma-separated name/value pairs. The format is:

"address='proxy_endpoint '{, userID='name ', password='password '} "

The address is required and can have a format such as:

http://hostname:port/path

Specify values for userID and password if the proxy server requires them.

Return values

Long. Valid values are 0 for success, and 50 for failure.

Examples

Example 3

This example specifies a user name and password, as well as the proxy endpoint:

long ll_return
string ls_string
ls_string = "address='http://Srvr:8080/endpnt',"
ls_string += "userID='MyName', password='mypass'"
ll_return = Conn.SetProxyServerOptions (ls_string)

Usage

Use this method or the SetProxyServer method if the proxy server requires authentication. The user ID and password that you supply with the SetOptions or other authentication methods apply to the URL of the Web service, not the proxy server.

See also


SetSoapLogFile

Description

Sets the name of a file for logging raw SOAP messages. This method is available for EasySoap Web services only.

Syntax

conn.SetSoapLogFile (string filename)

Argument

Description

conn

The name of the SoapConnection object that establishes the connection.

filename

A string containing the full file name for the SOAP log file. To disable logging, enter an empty string ("").

Return values

Long. Valid values are 0 for success, and 50 for failure.

Usage

You can call the SetSOAPLogFile method instead of including a log file name in the options argument of the SetOptions method.

See also


SetTimeout

Description

Sets the timeout value for a SOAP connection.

Syntax

conn.SetTimeout (long seconds)

Argument

Description

conn

The name of the SoapConnection object that establishes the connection.

seconds

The timeout value in seconds. If this option is set to 0, no timeout will be set on the client side. (The Web service might still have a timeout value on the server side.)

Return values

Long. Valid values are 0 for success, and 50 for failure.

Usage

You can call the SetTimeout method instead of including a timeout value in the options argument of the SetOptions method.

See also


UseConnectionCache

Description

Determines whether a connection cache is used for the Web service connection. This method is available for EasySoap Web services only.

Syntax

conn.UseConnectionCache (boolean cache)

Argument

Description

conn

The name of the SoapConnection object that establishes the connection.

cache

A boolean that determines whether the http connection of the proxy instance is kept alive after a call to the proxy. The default value is false. For Web services on EAServer, you must not change the default.

Return values

Long. Valid values are 0 for success, and 50 for failure.

Usage

You can call the UseConnectionCache method instead of setting a connection cache in the options argument of the SetOptions method.

See also


UseIntegratedWindowsAuthentication

Description

Determines whether the SoapConnection object uses Integrated Windows Authentication to connect to a Web service. This method is available for .NET Web services only.

Syntax

conn.UseIntegratedWindowsAuthentication (boolean useIWA)

Argument

Description

conn

The name of the SoapConnection object that establishes the connection.

useIWA

A boolean that determines whether to use Integrated Windows Authentication. If this option is set to “yes,” you do not need to set the UserID, Password, or Domain options.

Return values

Long. Valid values are 0 for success, and 50 for failure.

Usage

You can call the UseIntegratedWindowsAuthentication method to set connection authentication instead of the options argument of the SetOptions method.

See also