【问题标题】:No Endpoint mapping found using annotation driven Spring WS 2.0.2 with dynamic wsdl使用带有动态 wsdl 的注释驱动的 Spring WS 2.0.2 找不到端点映射
【发布时间】:2011-10-06 14:21:15
【问题描述】:

我正在使用注解驱动的 Spring WS 2.0.2 创建一个简单的 Webservice,但是没有找到 enpoint 映射。

输入和输出是 jdom 元素,以使其尽可能简单。

Web 服务在 Tomcat 6.0.29 上使用 Java 1.6 运行,但返回错误 页面(请求的资源()不可用)到我的 SoapUI 服务测试。

这是我在日志记录中遇到的错误:

WARNING: No endpoint found for [SaajSoapMessage (http://foo.bar/myTest)myRequest]

以下是我认为与端点映射相关的配置部分: (如果我缺少更多相关部分,请回复...)

架构 (WEB-INF/xsd/myTest.xsd)

targetNamespace="http://foo.bar/myTest"

...

<element name="myRequest" type="tns:string"/>
<element name="myResponse" type="tns:string"/>

web.xml (WEB-INF/web.xml)

<servlet-class>
org.springframework.ws.transport.http.MessageDispatcherServlet
</servlet-class>
<init-param>
  <param-name>contextConfigLocation</param-name>
  <param-value>/WEB-INF/spring/config.xml</param-value>
</init-param>
<init-param>
  <param-name>transformWsdlLocations</param-name>
  <param-value>true</param-value>
</init-param>

弹簧配置 (/WEB-INF/spring/config.xml)

<sws:annotation-driven/>

<sws:dynamic-wsdl id="myTest"
  portTypeName="myTest"
  localUri="/"
  targetNamespace="http://foo.bar/myTest">
  <sws:xsd location="/WEB-INF/xsd/myTest.xsd"/>
</sws:dynamic-wsdl>

端点 (src/main/java/bar/foo/MyEndpoint.java)

@Endpoint
public class MyEndpoint{
  @PayloadRoot(localPart="myRequest",namespace="http://foo.bar/myTest")
  @ResponsePayload
  public Element mySearch( @RequestPayload Element myRequest){
     return myRequest;
  }
}

【问题讨论】:

    标签: annotations wsdl spring-ws


    【解决方案1】:

    搜索解决方案我发现它包含在this answer

    添加

    ...
    xmlns:context="http://www.springframework.org/schema/context"
    ...
    xsi:schemaLocation=" ...
    http://www.springframework.org/schema/context
    http://www.springframework.org/schema/context/spring-context-3.0.xsd ... "
    
    <context:component-scan base-package="bar.foo"/>
    

    在我的 Spring 配置中让 servlet 找到我的 Endpoint。

    我的问题是,我发现的 spring 文档中没有示例代码 此步骤及其相关性。

    嗯 - 实际上我在之前的教程中发现了这个代码片段,但它有点超载我不需要的功能,并且在官方文档中没有解释为什么它是必要的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-12-06
      • 1970-01-01
      • 1970-01-01
      • 2014-10-06
      • 2014-12-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多