0

我正在尝试使用 wsdl first 方法和 CXF 创建 Web 服务。我能够从 wsdl 生成 java 文件并将 war 文件部署到 tomcat 服务器。但是,我在生成的文件中看不到任何soapaction。如何识别此 Web 服务的端点 url?

谢谢,

4

1 回答 1

0

通常在 CXF 中,您使用 Spring 配置来配置端点,如JAX-WS 配置中所述。通常地址是相对的,例如

<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:jaxws="http://cxf.apache.org/jaxws"
    xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">

    <jaxws:endpoint id="classImpl"
        implementor="org.apache.cxf.jaxws.service.Hello"
        address="/helloService"/>

</beans>

地址是您的 Web 应用上下文根的本地地址。

假设您的 Web 应用程序的名称是SomeWebApp并且服务器可用,localhost:8080那么 Web 服务应该在http://localhost:8080/SomeWebApp/helloService. 您可以在以下位置对其检索 WSDL 进行测试:http://localhost:8080/SomeWebApp/helloService?wsdl。此 URL 可用于创建 SOAP UI 项目(我非常推荐用于探索和测试 SOAP 服务的工具)。

如果您不使用 Spring 配置端点或仍然无法访问 Web 服务,请提供有关您的配置的更多详细信息。

于 2013-10-26T18:00:31.653 回答