【问题标题】:How to identify cxf web service end point如何识别 cxf Web 服务端点
【发布时间】:2013-10-27 02:00:31
【问题描述】:

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

谢谢,

【问题讨论】:

    标签: web-services cxf


    【解决方案1】:

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

    <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 应用程序的名称是 SomeWebApp 并且服务器在 localhost:8080 可用,那么 Web 服务应该在 http://localhost:8080/SomeWebApp/helloService 发布。您可以在http://localhost:8080/SomeWebApp/helloService?wsdl 处对其检索 WSDL 进行测试。此 URL 可用于创建 SOAP UI 项目(我非常推荐用于探索和测试 SOAP 服务的工具)。

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-05-02
      • 2014-07-02
      • 2013-07-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多