2015-04-17 3 views
0

Я получаю эту ошибку для данного класса конечных точек:Spring WS конечная точка отображается дважды

Cannot map endpoint [public org.iaws.data.model.Theaters iaws.ws.soap.resources.TheaterEndpoint.getTheaters(java.lang.String,java.lang.String) throws java.sql.SQLException] on registration key [{http://iaws/ws/contractfirst/example}data]: there's already endpoint [public org.iaws.data.model.Theaters iaws.ws.soap.resources.TheaterEndpoint.getTheaters(java.lang.String,java.lang.String) throws java.sql.SQLException] mapped

Почему конечная точка отображается дважды?

@Endpoint 
public class TheaterEndpoint { 

private final static String NAMESPACE = "http://soap/ws/contractfirst/example"; 

@PayloadRoot(namespace = NAMESPACE, localPart = "data") 
@Namespace(prefix="dt", uri = NAMESPACE) 
@ResponsePayload 
public Theaters getTheaters(
     @XPathParam("/dt:data/dt:movieId") final String movieId, 
     @XPathParam("/dt:data/dt:location") final String location) 
     throws SQLException { 
    TheaterSearch data = new TheaterSearch(movieId, location); 
    if (data.getMovieId() == null && data.getLocation() == null) { 
     throw new IllegalArgumentException(); 
    } else { 
     if (data.getMovieId() == null) { 
      return db.getTheaters(data.getLocation()); 
     } else { 
      if (data.getLocation() == null) { 
       return db.getTheatersForMovie(data.getMovieId()); 
      } else { 
       Theaters theaters = db.getTheatersForMovie(
         data.getMovieId(), data.getLocation()); 
       return theaters; 
      } 
     } 
    } 
} 

}

ответ

1

Я пытался исправить подобную проблему и следующие работали.

В MessageDispatcherServlet (spring-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:sws="http://www.springframework.org/schema/web-services" 
    xmlns:context="http://www.springframework.org/schema/context" 
    xsi:schemaLocation=" 
     http://www.springframework.org/schema/beans 
     http://www.springframework.org/schema/beans/spring-beans-3.1.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"> 

    <!-- 
    enables support for endpoint annotation, as per spring docs. 
    Forums ask to use this along with component scan. See SWS Bug 702 
    <link>http://stackoverflow.com/questions/6198644/spring-3-sws2-difference-between-contextcomponent-scan-and-swsannotation</link> 
    --> 
    <sws:annotation-driven /> 

    <context:component-scan base-package="com.pkg.endpoint" /> 

    <sws:dynamic-wsdl id="holiday" 
         portTypeName="HumanResource" 
         locationUri="/holidayService/" 
         targetNamespace="http://mycompany.com/hr/definitions"> 
     <sws:xsd location="/WEB-INF/schema/holiday.xsd"/> 
    </sws:dynamic-wsdl> 

    <!-- REMOVE THIS BEAN --> 
    <bean id="holidayEndpoint" class="com.pkg.endpint.HolidayEndpoint" /> 

</beans> 
Смежные вопросы