是否可以使用Spring-WS从WSDL文件创建WS-client? (似乎没有)

时间:2012-12-10 15:31:20

标签: java spring wsdl spring-ws

我想知道是否可以使用Spring Web Services从WSDL文件创建Web服务客户端

我的意思是从WSDL开始,我暂时没有任何XSD。

但我已经阅读了Josh Long的“Spring Recipes A Problem-Solution Approach”,Hamidreza Sattari的“Spring Web Services 2 Cookbook”和教程本身(6. Using Spring Web Services on the Client),并且没有提及此功能。

我还阅读了其他帖子,例如Webservice-Client: Common approach with Spring WS, JAXB and just one WSDL file?Spring-ws client from WSDL(此处为stackoverflow),但没有任何进一步的结果。

我甚至在Spring论坛上提出了这个问题,但在超过60次阅读后没有回复:Is it possible to create a WS-client from WSDL file using SWS? (It seems not)

也许这是不可能的。

感谢。

1 个答案:

答案 0 :(得分:14)

你可以这样做:

  1. 使用JDK发行版附带的xjc工具生成java类型 - xjc -wsdl file.wsdl

  2. 然后使用生成的java类型,使用WebserviceTemplate,描述here来创建客户端。