org.springframework.ws.client.core.WebServiceTemplate.setCheckConnectionForFault()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(1.6k)|赞(0)|评价(0)|浏览(116)

本文整理了Java中org.springframework.ws.client.core.WebServiceTemplate.setCheckConnectionForFault()方法的一些代码示例,展示了WebServiceTemplate.setCheckConnectionForFault()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebServiceTemplate.setCheckConnectionForFault()方法的具体详情如下:
包路径:org.springframework.ws.client.core.WebServiceTemplate
类名称:WebServiceTemplate
方法名:setCheckConnectionForFault

WebServiceTemplate.setCheckConnectionForFault介绍

[英]Indicates whether the FaultAwareWebServiceConnection#hasFault() should be checked for fault indicators ( true), or whether we should rely on the FaultAwareWebServiceMessage#hasFault() only ( false). The default is true.

When using an HTTP transport, this property defines whether to check the HTTP response status code for fault indicators. Both the SOAP specification and the WS-I Basic Profile define that a Web service must return a "500 Internal Server Error" HTTP status code if the response envelope is a Fault. Setting this property to false allows this template to deal with non-conforming services.
[中]指示是否应检查FaultAwareWebServiceConnection#hasFault()的故障指示灯(true),或是否应仅依赖FaultAwareWebServiceMessage#hasFault()(false)。默认值为true。
使用HTTP传输时,此属性定义是否检查HTTP响应状态代码中的故障指示器。SOAP规范和WS-I基本概要文件都定义,如果响应信封出现故障,Web服务必须返回“500内部服务器错误”HTTP状态代码。将此属性设置为false将允许此模板处理不符合要求的服务。

代码示例

代码示例来源:origin: org.springframework.boot/spring-boot

@Override
public void customize(WebServiceTemplate webServiceTemplate) {
  webServiceTemplate.setCheckConnectionForFault(this.checkConnectionFault);
}

代码示例来源:origin: stackoverflow.com

public void startServer() {
  webServiceTemplate.setCheckConnectionForError(false);
  webServiceTemplate.setCheckConnectionForFault(false);

相关文章

WebServiceTemplate类方法