fglwsdl

The fglwsdl tool produces web services stub files for client or server programs (from WSDL / XSD).

Syntax

fglwsdl command [options] [ argument ]
  1. command indicates what operation must be done by fglwsdl.
  2. options are described in fglwsdl options.
  3. argument is a parameter for command.

Options

Table 1. fglwsdl commands
Command Description
-V Displays version information.
-h Displays options for the tool.
-l List services from a WSDL or variables from a XSD
-c [options] wsdl-spec

Generate client stub (default) to be used in a GWS client application. wsdl-spec is the name of a WSDL description file or the URL of a WSDL description for a published web service. Typically, http://host/service?WSDL.

The options are listed in Table 2 and Table 4.
-s [options] wsdl-spec

Generate server stub to be used in a GWS server application. wsdl-spec is the name of a WSDL description file or the URL of a WSDL description for a published web service. Typically, http://host/service?WSDL.

The options are listed in Table 2 and Table 4.
-x [options] xsd-spec

Generate BDL data types from a XML schema (XSD). xsd-spec is the name of an XML schema file or the URL of an XSD schema resource on the web.

The options are listed in Table 3 and Table 4.

-regex regex value Validate the value against the regex regular expression described in XML schema specification.
Table 2. WSDL Options
Options Description
-o file Specify a base name for the output files.
-n service port Generate only for the given service name and port type.
-b binding Generate only for the given binding.
-prefix name Add name as the prefix of the generated web service functions, variables and types. (name can contain %s for servicename, %p for portname and %f for filename)
-compatibility Generate a Genero 1.xx compatibility client stub.
-fRPC Force RPC convention; use RPC Convention to generate the code, regardless of what the WSDL information contains.
-fRPCNamespace Generate code to support the namespace attribute for RPC parameters.
-disk Save WSDL and all dependencies from a URL on the disk.
Note: To generate code at the same time, you must use the option -c, -s, or both. Otherwise, no code is generated.
-domHandler Generates the use of DOM in the client stub and calls to callback handlers.
-alias Generates FGLPROFILE Logical names in place of URLs for the client stub.
-soap11 Generates only client and server stubs supporting SOAP 1.1 protocol.
-soap12 Generates only client and server stubs supporting SOAP 1.2 protocol.
-ignoreFaults Do not generate extra code to handle SOAP faults.
-wsa { yes | no } Force support of WS-Addressing 1.0 if yes, disable support of WS-Addressing 1.0 if no, otherwise support WS-Addressing 1.0 according to the WSDL definition.
-mtom { yes | no } Override the WSDL MTOM policy with this option. If yes, generates the stub with MTOM support. If no, generates the stub without MTOM support. This option can be applied to the client side or server side.
-xmlname Generate the name of variables with XMLName attributes when generating stubs. This option may be useful when you need to serialize sub records.
Table 3. XSD Options
Options Description
-o file Name of the output file. If file has no extension, .inc is added.
-n name [ ns ] Generate only for the given variable name and namespace (if there is one).
-prefix name Add name as the prefix of the generated data types.
-disk Save XSD and all dependencies from a URL on the disk.
Note: No code is generated.
-hexb64AsString Generate all XSD base64 and hexBinary type as BDL STRING.
If the WSDL has a Message Transmission Optimization Mechanism (MTOM) policy, the tool generates any xsd:base64Binary and xsd:hexBinary as a STRING data type with the XMLOptimizedContent attribute (instead of a BYTE data type). The STRING represents a file name on disk, that will be handled as a SOAP-attached file.
Tip: This option is useful for avoiding loading a file into a BYTE each time you want to send a big file.

If the WSDL does not have an MTOM policy, the tool generates any xsd:base64Binary and xsd:hexBinary as a STRING data type (instead of a BYTE data type). The programmer is responsible for setting a base64 or hexbinary value to the STRING in order to avoid a XML serialization error with the peer, as the latter expects a base64 or an hexbinary value.

Table 4. Common options
Options Description
-comment Add XML comments to the generation.
-fArray Force XML array generation instead of XML list when possible. If the WSDL contains an XML definition of a BDL list, generate a BDL array matching the same definition.
-fInheritance Force generation of XML choice records for all inheritance types found in the schemas, otherwise only for abstract types and elements.
-fInlineTypes Force generation of TYPE definitions for all global inlined types found in the schemas.
-noFacets Don't generate facet constraints restricting the value-space of simple data type.
-legacyTypes Don't generate BIGINT, TINYINT and BOOLEAN data types.
-ignoreMixed Ignore the attribute mixed="true" that allows mixed content to appear between child elements of complexType elements in XML schemas. When generating code from a WSDL using mixed complex types (<xs:complexType mixed="true">), fglwsdl will produce an error message: Mixed complexType is not supported if the option is not used.
-ext schema Add an external schema. See option '-extDir'.
-extDir directory Add all external schema files ending with .xsd in the directory.
Note: External schemas for dependencies won't be included in the WSDL description or in the XSD schema if their location attributes are missing. Use this option to add a missing external schema for a WSDL or XSD dependency.
-noValidation Disable XML schema validation warnings.
-autoNsPrefix nb Automatic prefix generation for variables and types using a substring of the namespace by removing the nb first elements (-1 means only the last element).

For example: If a variable belongs to the namespace http://www.mycompany.com/Global/Service, a value of -1 will give Service as a prefix, and a value of 1 will give Global_Service as a prefix.

-nsPrefix ns value Add value as prefix of the generated variables and types belonging to namespace ns (supersede the -prefix and the -autoNsPrefix option, and can be called several times).
Table 5. Network options (when specifying a URL)
Options Description
-noHTTP Disable HTTP - search for the WSDL description or the XML schema and its dependencies on the client instead of the internet. Useful, for example, if a company has restricted access to the internet.
-proxy location Connect via proxy where location is host[:port] or ip[:port].
-pAuth login pass Proxy authentication login and password.
-hAuth login pass HTTP authentication login and password.
-cert cert File of the X509 PEM-encoded certificate for HTTPS purpose.
-key key File of the PEM-encoded private key for HTTPS purpose.
-wCert cert Certificate name in the Windows® keystore for HTTPS purposes (Windows only).
-CA list A file name with the list of concatenated X509 PEM-encoded certificate authorities. (On Windows, if not set, the Certificate Authority list of the key store is used).

Usage

The fglwsdl command line tool produces the WSDL description of a web service that will be accessed by a GWS client application, or to define a WSDL description for creating a corresponding GWS server application. The tool generates the BDL data types from XML schemas (also known as XSD).

To access a remote web service, you must get the WSDL information from the service provider. Sample services can be found through UDDI registries, for example (http://www.uddi.org).