org.springframework.ws.soap.client.SoapFaultClientException:服务器无法处理请求。 --->超时已过期

时间:2016-10-14 18:05:07

标签: java spring web-services soap

我正在尝试使用spring doc中给出的SOAP Web使用者示例 spring doc

但是,当我尝试将Applicaiton类作为Spring Boot App运行时,我会继续获得以下内容。

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v1.4.1.RELEASE)

2016-10-14 10:58:08.193  INFO 4496 --- [           main] hello.Application                        : Starting Application on bumblebee with PID 4496 (C:\Users\menuka\workspace\monkey-api-netbeans\gs-consuming-web-service-complete\target\classes started by menuka in C:\Users\menuka\workspace\monkey-api-netbeans\gs-consuming-web-service-complete)
2016-10-14 10:58:08.196  INFO 4496 --- [           main] hello.Application                        : No active profile set, falling back to default profiles: default
2016-10-14 10:58:08.244  INFO 4496 --- [           main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@37918c79: startup date [Fri Oct 14 10:58:08 PDT 2016]; root of context hierarchy
2016-10-14 10:58:08.808  INFO 4496 --- [           main] o.s.oxm.jaxb.Jaxb2Marshaller             : Creating JAXBContext with context path [hello.wsdl]
2016-10-14 10:58:08.900  INFO 4496 --- [           main] o.s.ws.soap.saaj.SaajSoapMessageFactory  : Creating SAAJ 1.3 MessageFactory with SOAP 1.1 Protocol
2016-10-14 10:58:08.902 DEBUG 4496 --- [           main] o.s.ws.soap.saaj.SaajSoapMessageFactory  : Using MessageFactory class [com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl]
2016-10-14 10:58:09.067  INFO 4496 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Registering beans for JMX exposure on startup
2016-10-14 10:58:09.076  INFO 4496 --- [           main] hello.WeatherClient                      : Requesting forecast for 94304
2016-10-14 10:58:09.083 DEBUG 4496 --- [           main] o.s.ws.client.core.WebServiceTemplate    : Opening [org.springframework.ws.transport.http.HttpUrlConnection@2fc6f97f] to [http://wsf.cdyne.com/WeatherWS/Weather.asmx]
2016-10-14 10:58:09.155 DEBUG 4496 --- [           main] o.s.ws.client.MessageTracing.sent        : Sent request [SaajSoapMessage {http://ws.cdyne.com/WeatherWS/}GetCityForecastByZIP]
2016-10-14 10:58:21.633 DEBUG 4496 --- [           main] o.s.ws.client.MessageTracing.received    : Received response [SaajSoapMessage {http://schemas.xmlsoap.org/soap/envelope/}Fault] for request [SaajSoapMessage {http://ws.cdyne.com/WeatherWS/}GetCityForecastByZIP]
2016-10-14 10:58:21.633 DEBUG 4496 --- [           main] o.s.ws.client.core.WebServiceTemplate    : Received Fault message for request [SaajSoapMessage {http://ws.cdyne.com/WeatherWS/}GetCityForecastByZIP]
2016-10-14 10:58:21.637  INFO 4496 --- [           main] utoConfigurationReportLoggingInitializer : 

Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2016-10-14 10:58:21.643 ERROR 4496 --- [           main] o.s.boot.SpringApplication               : Application startup failed

java.lang.IllegalStateException: Failed to execute CommandLineRunner
    at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:803) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
    at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:784) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
    at org.springframework.boot.SpringApplication.afterRefresh(SpringApplication.java:771) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:316) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1186) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1175) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
    at hello.Application.main(Application.java:15) [classes/:na]
Caused by: org.springframework.ws.soap.client.SoapFaultClientException: Server was unable to process request. ---> Timeout expired.  The timeout period elapsed prior to obtaining a connection from the pool.  This may have occurred because all pooled connections were in use and max pool size was reached.
    at org.springframework.ws.soap.client.core.SoapFaultMessageResolver.resolveFault(SoapFaultMessageResolver.java:38) ~[spring-ws-core-2.3.0.RELEASE.jar:2.3.0.RELEASE]
    at org.springframework.ws.client.core.WebServiceTemplate.handleFault(WebServiceTemplate.java:830) ~[spring-ws-core-2.3.0.RELEASE.jar:2.3.0.RELEASE]
    at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:624) ~[spring-ws-core-2.3.0.RELEASE.jar:2.3.0.RELEASE]
    at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:555) ~[spring-ws-core-2.3.0.RELEASE.jar:2.3.0.RELEASE]
    at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:390) ~[spring-ws-core-2.3.0.RELEASE.jar:2.3.0.RELEASE]
    at hello.WeatherClient.getCityForecastByZip(WeatherClient.java:29) ~[classes/:na]
    at hello.Application.lambda$lookup$0(Application.java:26) [classes/:na]
    at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:800) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
    ... 6 common frames omitted

2016-10-14 10:58:21.644  INFO 4496 --- [           main] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@37918c79: startup date [Fri Oct 14 10:58:08 PDT 2016]; root of context hierarchy
2016-10-14 10:58:21.646  INFO 4496 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Unregistering JMX-exposed beans on shutdown

这里发生了什么?有人可以在这里提出建议吗?

1 个答案:

答案 0 :(得分:1)

此SOAP操作目前不可用。 您可以在浏览器上自行尝试:http://wsf.cdyne.com/WeatherWS/Weather.asmx?op=GetCityForecastByZIP

如果您输入94304并点击“Invoke”,则会收到错误:

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)