2

我需要用 WSDL 创建一个客户端。我有一个带有 JSF、Spring 和 JPA 的 Java Web 应用程序。在这个应用程序中,我需要创建一个表单并将信息发送到 SOAP Web 服务。此服务应返回另一个具有状态的对象。

请,任何想法我将不胜感激

问候

对不起我的英语

4

1 回答 1

0

我假设您已经从客户端所需的 WSDL 生成了类。在 Spring 中,使用Apache CXF非常简单。例如:

<jaxws:client id="yourService"
              serviceClass="com.something.YourService"
              address="the URL of web service"
              username="username"
              password="password"/>

在您需要调用此 Web 服务的班级中,只需自动装配它:

@Autowired
@Qualifier("yourService")
private YourService service;

看一下例子:http ://cxf.apache.org/docs/writing-a-service-with-spring.html

于 2013-05-03T12:06:49.940 回答