Previous Next

CONNECT( ) method (Web service)
Connects to and associates a Web service instance with the specified server handle. The current application becomes a client application of the connected Web service.
Return type:
Applies to:
 
Syntax 
CONNECT ( [ connection-parms ] )
connection-parms
A character string containing a space‑separated list of one or more connection parameters.
Table 72 describes each Web service connection parameter you can include in this string. This method ignores any other strings included in this parameter.
 
-WSDL wsdl-document 
-WSDLUserid user-id 
Optional user account name to use in connecting to the Web service that hosts the WSDL document. If -WSDLUserid is specified and -WSDLPassword is not, the AVM uses a blank password.
-WSDLPassword password 
Optional password to use with -WSDLUserid. This attribute is ignored if -WSDLUserid is not specified.
-Service service-name 
-ServiceNamespace service-namespace 
-Port port-name 
The local name of the port element contained within the service element. Used in conjunction with -Service. This parameter is optional if -Service contains only one port.
-Binding binding-name 
The local name of the binding element contained in the WSDL document. Used in conjunction with -SoapEndpoint. This parameter is optional if the WSDL contains only one binding.
-BindingNamespace binding-namespace 
-SOAPEndpoint URL-endpoint 
The URL identifying the endpoint for this Web service. Used in conjunction with -Binding. It is an error to use this parameter in conjunction with -Service or -Port.
-SOAPEndpointUserid user-id 
Optional user account name to use to connect to a Web service that hosts the Web Server application. If -SOAPEndpointUserid is specified and -SOAPEndpointPassword is not, the AVM uses a blank password.
-SOAPEndpointPassword password 
Optional password to use with the -SoapEndpointUserid. This attribute is ignored if -SoapEndpointUserid is not specified.
-TargetNamespace targetNamespace 
-connectionLifetime nSeconds 
-maxConnections num-connections 
-nosessionreuse 
-nohostverify 
-pf filename 
Note:
-WSDL parameter security options
The -WSDL parameter can optionally contain a user account name and password to use to connect to a Web Server. This is the syntax for specifying the parameter using the HTTP and HTTPS protocols, respectively:
 
Syntax 
-WSDL http://[user-id[:password]@]web-server-host[:web-server-port]WSDL-path
 
-WSDL https://[user-id[:password]@]web-server-host[:web-server-port]WSDL-path
user-id
User account name to use to connect to a Web service that hosts the WSDL document. If user-id is specified and password is not, the AVM uses a blank password.
password
Password to use with the user-id. This parameter is ignored if user-id is not specified.
web-server-host
TCP/IP host address of the Web Server that hosts the WSDL document.
web-server-port
TCP/IP port address of the Web Server that host the WSDL document. The default port is 80 for HTTP and 443 for HTTPS.
WSDL-path
URL path to the WSDL document for the Web service.
Instead of building the account name and password into the WSDL string, you can specify the account name using the -WSDLUserid parameter and the password using the -WSDLPassword parameter. If these parameters are used and the WSDL URL (WSDL-path) also contains a user id and password, the information on the WSDL URL is used.
Connection parameter combinations
The CONNECT( ) method is used to connect an ABL SERVER object to a specific application service. This service can be either an AppServer or a Web service. Independent of the type of application service to which the client is connecting, the client needs to provide the location of the service and transport information. There are two mechanisms for providing this information when connecting to a Web service:
1.
If the WSDL document contains several service elements, the CONNECT method must identify which service element the client wants to connect to, via -Service. If the WSDL document only identifies one service element, the CONNECT method does not need to contain the service element name. Similarly if the WSDL document (or if the identified service element) only identifies one port element, the CONNECT method does not need to contain the port element name.
If the application needs to provide account name and password information, it can accomplish this by providing the account name and password information in the -SoapEndpointUserid and -SoapEndpointPassword parameters.
If the WSDL document identifies multiple service elements with the same local name, the CONNECT ( ) method must also contain the -ServiceNamespace connection parameter.
2.
If the WSDL document contains several binding elements, the CONNECT method must identify which binding element the client wants to use, via the -Binding parameter. If the WSDL document only identifies one binding element, the CONNECT method does not need to contain the binding element name.
If the application needs to provide account name and password information, it can accomplish this by providing the account name and password information in the -SoapEndpointUserid and -SoapEndpointPassword parameters.
If the WSDL document identifies multiple binding elements with the same local name, the CONNECT( ) method must also contain the -BindingNamespace connection parameter.
If an error occurs while executing the CONNECT( ) method, the method returns FALSE. Otherwise, it returns TRUE. An error can occur if:
*
*
*
One of the values specified in the connection-parms parameter is invalid.
*
The -TargetNamespace does not match the value contained in the WSDL document.
*
*
The -WSDLUserid or -WSDLPassword is not valid.
If the CONNECT( ) method completes successfully, the CONNECTED( ) method returns TRUE.
The connection lasts until the client application executes the server handle DISCONNECT( ) method or until the AVM detects any failure condition that automatically terminates the connection.

Previous Next
© 2013 Progress Software Corporation and/or its subsidiaries or affiliates.