Using the .NET Web service engine

Generating a .NET assembly

If you select the .NET Web service engine in the Web Service Proxy wizard, the wizard generates a .NET assembly (DLL) in addition to a proxy object. To use the Web service at runtime, you must deploy the wizard-generated DLL along with your application.

You can also select the .NET Web service engine in the Project painter for a new Web service proxy. If you select the .NET Web service engine on the Web Service tab of the Properties dialog box for the Web Service Proxy Generator, PowerBuilder attempts to generate an assembly DLL after you click Apply or OK. You cannot use the Properties dialog box to change the Web service engine for a proxy that you have already generated with the Web Service Proxy wizard.

Naming the DLL You can name the DLL generated by the Web Service Proxy wizard or by the Project painter in the Proxy Assembly Name text box. You do not need to include the DLL extension. The name of the wizard-generated assembly is Web_service.DLL, where Web_service is the name you provide in the Proxy Assembly Name field. If you do not provide a name, the assembly takes the name of the Web service to be consumed by the DLL. The assembly is generated in the current target directory.

Deploying the DLL You must deploy the DLL created for your Web service project to the directory where you deploy the client executable. You must also copy the Sybase.PowerBuilder.WebService.Runtime.dll and the Sybase.PowerBuilder.WebService.RuntimeRemoteLoader.dll system assemblies to this directory.

New extension class library

Although you use the same SOAP connection and exception-handling classes for the .NET Web service engine as for the EasySoap Web service engine, the classes that reference the .NET Web service engine require a different extension file or library.

For more information, see “Importing objects from an extension file” in Application Techniques.

Adding security information to the SOAP client header

You can use the SetOptions function of the SoapConnection class to include security information in the SOAP client header. Alternative methods provide a preferred way of adding security information.

For information on the alternative methods, see “New methods for the SoapConnection object”.

You can include the following options in the Options argument of the SetOptions function for a .NET Web service client:

.NET security option

Description

Domain

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

UseWindowsAuthentication

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

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 at http://msdn2.microsoft.com/en-us/library/w67h0dw7.aspx.

CertificateFile

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.

With the .NET Web service engine, you cannot use the SoapLog or ConnectionCache parameters in the Options argument of the SetOptions method.