使用 wsadmin 命令行工具配置其他 HTTP 传输属性

可以使用 wsadmin 命令行工具来配置 Java™ API for XML-based RPC (JAX-RPC) Web service 的其他 HTTP 传输属性。

开始之前

WebSphere® Application Server wsadmin 工具提供运行脚本的能力。您可以使用 wsadmin 工具管理 WebSphere Application Server 安装以及配置、应用程序部署和服务器运行时操作。WebSphere Application Server 仅支持 Jacl 和 Jython 脚本语言。有关 wsadmin 工具选项的更多信息,请查看关于 AdminApp 对象 install、installInteractive、edit、editInteractive、update 和 updateInteractive 命令的选项的信息。

关于此任务

本任务是您可以为充当另一个 Web Service 的客户机的 Web Service,配置其他 HTTP 传输属性的三种方法中的一种。还可以用以下各方式配置其他 HTTP 传输属性:

如果要使用基于 Java API XML-based Remote Procedure Call (JAX-RPC) 编程模型或 Java API for XML Web Services (JAX-WS) 编程模型以编程方式来配置这些属性,请查看 JAX-RPC 或 JAX-WS 规范。有关受支持的标准和规范的完整列表,请参阅 Web service 规范和 API 文档。

有关以下您可以配置的 HTTP 属性的更多信息,请阅读 Web Service 应用程序的 HTTP 定制属性:
  • com.ibm.websphere.webservices.http.requestContentEncoding
  • com.ibm.websphere.webservices.http.responseContentEncoding
  • com.ibm.websphere.webservices.http.connectionKeepAlive
  • com.ibm.websphere.webservices.http.requestResendEnabled
  • com.ibm.websphere.webservices.http.SocketTimeout
  • com.ibm.ws.webservices.enableHTTPPrefix
  • http.proxyHost
  • http.proxyPort
  • https.proxyHost
  • https.proxyPort
  • http.nonProxyHosts - 只能将此属性配置为 JVM 定制属性。此属性适用于 HTTP 和 HTTPS 连接。

这些是为使用 HTTP 协议的 Web Service 应用程序配置的其他属性。这些属性影响 HTTP 请求、HTTP 响应中的消息的内容编码、HTTP 连接持久性和存在读超时时发生 java.net.ConnectException 错误后重新发送的 HTTP 请求的行为。

用本任务部分中提供的以下步骤,使用 wsadmin 工具配置其他 HTTP 属性:

过程

  1. 启动脚本命令
  2. wsadmin 命令提示符下,输入命令语法。 您可以使用 install、installInteractive、edit、editInteractive、update 和 updateInteractive 命令。
  3. 如果您要配置 com.ibm.websphere.webservices.http.responseContentEncoding 属性,请使用 WebServicesServerCustomProperty 命令选项。
    避免故障 避免故障: 此属性仅适用于 JAX-RPC,如果为基于 JAX-WS 的服务启用了此属性,将不会使用此属性。gotcha
  4. 使用 WebServicesClientCustomProperty 命令选项配置所有其他属性。
  5. $AdminConfig save 命令保存配置更改。

结果

您为 Web Service 应用程序配置了 HTTP 传输属性。

示例

下面说明 Jython 脚本语法的示例:
AdminApp.edit ( 'PlantsByWebSphere', '[ -WebServicesClientCustomProperty [[PlantsByWebSphere.war "" 
service/FrontGate_SEIService FrontGate http.proxyHost+http.proxyPort myhost+80]]]') 
AdminConfig.save()
AdminApp.edit ( 'WebServicesSamples', '[ -WebServicesServerCustomProperty 
[[AddressBookW2JE.jarAddressBookService AddressBook http.proxyHost+http.proxyPort myhost+80]]]') 
AdminConfig.save()
下面说明 Jacl 脚本语法的示例:
$AdminApp edit PlantsByWebSphere {  -WebServicesClientCustomProperty {{PlantsByWebSphere.war {} service/FrontGate_SEIService FrontGate  http.proxyHost+http.proxyPort myhost+80 }}} 
$AdminConfig save 
$AdminApp edit WebServicesSamples {-WebServicesServerCustomProperty {{AddressBookW2JE.jar 
AddressBookService AddressBook http.proxyHost+http.proxyPort myhost+80}}} 
$AdminConfig save
要将这些示例从 edit 转换到 install,添加 .ear 以形成文件名,并且为部署添加任何额外的关键字,例如 -usedefaultbindings-deployejb

指示主题类型的图标 任务主题



时间戳记图标 最近一次更新时间: last_date
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=txml_configaddhttppropertieswsadmin
文件名:txml_configaddhttppropertieswsadmin.html