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

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

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

WebServiceTemplate.setCheckConnectionForError介绍

[英]Indicates whether the WebServiceConnection#hasError() should be checked for error indicators ( true), or whether these should be ignored ( false). The default is true.

When using an HTTP transport, this property defines whether to check the HTTP response status code is in the 2xx Successful range. Both the SOAP specification and the WS-I Basic Profile define that a Web service must return a "200 OK" or "202 Accepted" HTTP status code for a normal response. Setting this property to falseallows this template to deal with non-conforming services.
[中]指示是否应检查WebServiceConnection#hasError()中的错误指示符(true),或是否应忽略这些指示符(false)。默认值为true。
使用HTTP传输时,此属性定义是否检查HTTP响应状态代码是否在2xx成功范围内。SOAP规范和WS-I基本概要文件都定义,对于正常响应,Web服务必须返回“200 OK”或“202 Accepted”HTTP状态代码。将此属性设置为false将允许此模板处理不符合要求的服务。

代码示例

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

@Override
public void customize(WebServiceTemplate webServiceTemplate) {
  webServiceTemplate.setCheckConnectionForError(this.checkConnectionForError);
}

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

webServiceTemplate.setCheckConnectionForError(false);
webServiceTemplate.setCheckConnectionForFault(false);

相关文章

WebServiceTemplate类方法