相关疑难解决方法(0)

端点SWS没有适配器

我正在尝试使用教程创建一个简单的Hello World WebService .

我正在运行Java 1.7.0_04,Spring 2.1,所有内容都是使用Maven构建的,并使用Tomcat6进行部署.但是,当尝试发送SOAP请求(soapUI)时,服务器返回我

No adapter for endpoint [public org.jdom.Element com.mycompany.hr.ws.HolidayEndpoint.handleHolidayRequest(org.jdom.Element) throws java.lang.Exception]: Is your endpoint annotated with @Endpoint, or does it implement a supported interface like MessageHandler or PayloadEndpoint?
Run Code Online (Sandbox Code Playgroud)

我认为注释有问题,但这是我的文件的样子:

web.xml中

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
         version="2.4">

    <display-name>Khozzy custom WebService</display-name>

    <servlet>
        <servlet-name>spring-ws</servlet-name>
        <servlet-class>org.springframework.ws.transport.http.MessageDispatcherServlet</servlet-class>

        <init-param>
            <param-name>transformWsdlLocations</param-name>
            <param-value>true</param-value>
        </init-param>
    </servlet>

    <servlet-mapping>
        <servlet-name>spring-ws</servlet-name>
        <url-pattern>/*</url-pattern>
    </servlet-mapping>

</web-app>
Run Code Online (Sandbox Code Playgroud)

弹簧-WS-servlet.xml中

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:sws="http://www.springframework.org/schema/web-services"
       xsi:schemaLocation=" http://www.springframework.org/schema/beans
                            http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
                            http://www.springframework.org/schema/web-services
                            http://www.springframework.org/schema/web-services/web-services-2.0.xsd
                            http://www.springframework.org/schema/context
                            http://www.springframework.org/schema/context/spring-context-3.0.xsd">

    <context:component-scan base-package="com.mycompany.hr.ws" …
Run Code Online (Sandbox Code Playgroud)

spring soap annotations adapter endpoint

7
推荐指数
1
解决办法
9427
查看次数

标签 统计

adapter ×1

annotations ×1

endpoint ×1

soap ×1

spring ×1