|
JSP Web services
You can use Web services in your JSP by generating custom tags for them. The JSP Web Service Proxy wizard on the Web page of the New dialog box creates a custom tag library with the information necessary for calling a Web service in a JSP.
你可以在你的JSP页面中通过创建自定义标签来使用Web Services。
在新建对话框中的网页JSP Web Service 代理向导,将创建包含了在JSP页面中调用一个Web Services必须的信息的一个自定义附加库。
Using the JSP Web Service Proxy wizard
The wizard collects information such as the location of a Web Services Description Language (WSDL) file, the service, and port. You can specify overrides to the WSDL file for a custom bean name, Java class name, Java package name, TLD name, JAR file name, output variables, and the selection of operations within a service. The wizard creates a TLD file, the Java source to process the custom tag, and the compiled Java class files of the source.
向导收集了例如网页服务描述语言(WSDL)文件的位置、服务、端口等相关信息。你可以列入清单重载WSDL文件的自定义实例名、Java类名、Java包名、TLD名、JAR文件名、输出变量和在一个服务中的操作选项等。向导将创建一个TLD文件,处理用户自定义标签的Java资源并将这些资源编译成Java类文件。
The wizard supports WSDL files with Remote Procedure Call (RPC) encoding, and can display the services, operations, ports, and method signatures related to RPC-encoded Web services. Any document-literal, document-encoded, or RPC-literal elements in the WSDL file are ignored by the wizard.
向导通过远程过程调用(RPC)来支持WSDL文件,编码和能显示服务、操作、端口和RPC编码相关的签名方法的Web服务。向导将忽略WDSL文件中的任何文本文档、加密文档或RPC中的文字元素。
The wizard can process a WSDL file without requiring additional class files (and property files registering user-defined datatypes) if the Web service referenced by the WSDL includes only the following datatypes:
- Simple XSD datatypes (string, short, long, int, float, double, boolean, void, byte)
- Arrays, including multi-dimensional arrays, of supported datatypes
- Jaguar and Java holder datatypes
如果被WSDL引用Web 服务的数据类型只包含如下的数据类型,向导可以不需要其它的附加的类文件来处理WSDL文件(特性文件会注册用户自定义数据类型):
简单的XSD数据类型(string, short, long, int, float, double, boolean, void, byte);
支持的简单数据类型的数组,包括多维数组;
Jaguar和Java支持的数据类型。
PowerBuilder client Web services wizard
The JSP Web Service Proxy wizard is similar to the Web Service Proxy wizard on the Project page of the New dialog box, but the latter creates a PowerBuilder client for a Web service and can only be used in PowerScript targets.
For more information about Web services and the Web Service Proxy project wizard, see the chapter on Web services in Application Techniques .
PowerBuilder Web services客户端向导
JSP Web Services代理向导和新建对话框中的项目选项卡中的Web Service 代理向导近似。但是后来创建的Web Services的PowerBuilder客户端只能用于PowerScript工程中。
关于Web Services和Web Service代理项目向导,请参照应用程序技术中的Web Services的相关章节。
Files added by the JSP Web Service Proxy wizard
The JSP Web Service Proxy wizard adds a client class JAR, logging, and property files to JSP target subdirectories, in addition to TLD and WSDL files, and a JAR file containing TLD classes. These client, logging, and property files are copied from the Class and Lib subdirectories of the Sybase\Shared\PowerBuilder\WEB-INF directory. When you deploy the JSP target, the copied files are deployed along with the other target files.
JSP Web Services代理向导添加的文件
JSP Web Services代理向导将添加除了TLD、WSDL文件和包含TLD类的JAR文件之外还添加一个JAR客户端的类,登录和JSP工程子目录的属性文件等。这些客户端、登录和属性文件是“Sybase\Shared\PowerBuilder\WEB-INF”类库目录的一个复制副本。在你配置JSP工程时,这些副本文件将和其它的工程文件一样被配置。
Table 8-7: Files added to target WEB-INF subdirectories
|
File added by wizard |
Description |
|
tlds\Service_Name.tld |
A default file name is provided by the Web service WSDL, but the JSP Web Services Proxy wizard lets you rename the TLD file that it adds to the target. |
|
lib\log4j-1.2.3.jar |
Contains the Log4j logging classes from the Apache Jakarta project. |
|
lib\Service_Name.jar |
A default file name is provided by the Web service WSDL, but the JSP Web Services Proxy wizard lets you rename the JAR file that it adds to the target. |
|
lib\swsclient.jar |
Contains client classes for accessing a Web service. |
|
classes\esdweblogger.props |
Determines the name and location for the file that logs JSP target activity, contains instructions for turning on logging, and sets the level of logging that occurs. By default, the log file name is esdweb.log. You must supply a full path to make sure the log file is created where you want it. |
|
classes\WebService.wsdl |
WSDL file you select in the wizard. |
|
classes\syuproxy.props |
Contains property-value pairs for information needed by the Web Services Proxy. Use this file to specify a default directory for locating WSDL files and the location of the user.encoding.props file. It also specifes the key store that holds certificates needed for https connections. |
|
classes\user.encoding.props |
Default file that serves as a placeholder. You must modify or replace this file if the Web service you want to access requires user defined datatypes. For more information, see "Web services with user datatypes". |
表8-7 加入到WEB-INF工程子目录下的文件
向导添加的文件 |
描述 |
tlds\Service_Name.tld |
WSDL WEB SERVICES 默认添加的文件名,但JSP Web Services代理向导允许你在把它添加到工程中重命名这个tld文件。 |
lib\log4j-1.2.3.jar |
包含了Apache Jakarta工程的log4j日志类 |
lib\Service_Name.jar |
WSDL WEB SERVICES 默认添加的文件名,但JSP Web Services代理向导允许你在把它添加到工程中重命名这个JAR文件。 |
lib\swsclient.jar |
包含访问Web Services的客户端类 |
classes\esdweblogger.props |
确定记录当前JSP工程名称和位置,包含交换日志的指令,设置日志发生的级别,缺省状态下,日志文件为esdweb.log。你必须指定可以创建日志文件的完整目录。 |
classes\WebService.wsdl |
你在向导中选择的WSDL文件。 |
classes\syuproxy.props |
包含了Web Services 代理所须的属性—值对信息,使用这个文件可以配置WSDL文件和user.encoding.props文件的默认搜索路径。也可以配置保存Http连接证书的键值。 |
classes\user.encoding.props |
默认的占位符服务文件,如果你需要在Web Services中使用用户自定义数据类型,必须修改和替换这个文件。更多信息,请参照《在Web Services中使用用户自定义数据类型》。 |
Other files required on the JSP server
JSP服务器上所需要的其它文件
At runtime, the JSP server where you deploy your target must have additional files in its class path for a Web service to work. If your server does not have these files in its class path, you can copy them to a directory in the server class path from the Sybase\Shared\PowerBuilder\WEB-INF\lib directory. These files are not deployed with your JSP target.
在运行时,在你配置你的应用程序的JSP服务器上使用Web Services,你必须另外加入一些文件到它的类搜索路径中,你可以从“Sybase\Shared\PowerBuilder\WEB-INF\lib”目下复制那些文件到服务器类目录下。
Table 8-8: Files required in JSP server class path
|
Required files |
Description |
| <P class=MsoNorma |
|
| |