我正在使用 Spring 和 eclipse 并尝试创建使用给定 XSD 的客户端代码,创建请求 XML 并将其发送到目标 URL 以获取响应。我收到以下错误:
org.springframework.ws.client.WebServiceIOException: I/O error: Connection refused: connect; nested exception is java.net.ConnectException: Connection refused: connect
at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:507)
at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:350)
at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:344)
at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:336)
at com.elkay.client.EliteDevOrdCrClient.addOrder(EliteDevOrdCrClient.java:61)
at com.elkay.client.EliteDevOrdCrClient.main(EliteDevOrdCrClient.java:75)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
请求 XML 已正确生成。
当我尝试对 SOAPUI 进行相同操作时,我能够获得所需的响应。
请指点一下,我哪里出错了。
蒂亚!