JSP targets in PowerBuilder use the Apache Software Foundation’s Axis software for Simple Object Access Protocol (SOAP) processing. The Axis software includes support for user-defined complex datatypes and document-type WSDL files.
Axis provides a WSDL2 Java tool that builds Java proxies and skeletons for Web services with WSDL descriptions. Axis follows the Java API for the XML-Based Remote Procedure Calls (JAX-RPC) specification when generating Java client bindings from the WSDL descriptions and generates only those bindings necessary for the client. Table 8-3 shows the type of Java file generated from each entry type in the WSDL file.
For each WSDL |
Java class generated |
---|---|
Type in the types section |
JavaBean |
complexType |
Holder if this type is used as an in/out parameter |
portType |
Java interface |
binding |
Stub class |
service |
Service interface and service implementation (the locator) |
In a JSP target, the authoring tool (HTML editor) is Unicode enabled, so you can input text in multiple languages on a single page. It accepts UTF-16 Unicode text only; however, JSP files with ANSI-encoded or UTF-8 text can still be imported in the editor. Text with these encodings is automatically converted to UTF-16.
Custom tags to be used in a JSP target are processed at design time. The code to process a custom tag invoking a Web service is generated in Java and compiled using the Java compiler in the JDK. The generated code uses the Java client binding class generated by the Axis toolkit.
The main purpose of the generated code is to provide the glue needed to call and pass arguments from a custom tag in a JSP to the Axis toolkit. The custom tag provides the ability to access both input and output arguments through attributes (for input variables) and scripting variables (for output variables). In addition, the ability to access the return value is provided by a scripting variable.
For a custom tag to function properly, three components must be created:
JavaBean to handle custom tag at runtime Each bean provides support for one operation in a WSDL file. All beans that support the same service in the WSDL file are placed in the same package. The default name of the package is the service name. The name of the package can be overridden by the user in the wizard.
For each argument in the Web service there is an instance variable in the class. If the argument is an input variable to the Web service, there is a setArgumentName method. If the argument is an output variable from the Web service, there is a getArgumentName method.
After the code has been generated, it is compiled to a .class file
TagLib directive in the JSP file When a Web service is added to a JSP page, a directive is added to the top of the JSP page to import the appropriate tag library.
Tag Library Descriptor (TLD) file A TLD is one of the three key components required for the use of a custom JSP tag. A TLD is an XML document that describes a tag library. A TLD contains information about the tag library as a whole and about each tag contained in the library. The generated TLD files are placed in the WEB-INF/services directory of the target application.