2013-11-01 103 views
0

我一直在挣扎PayloadValidatingInterceptor,我使用的是Spring 3.2,并且在我的webservice中,我只有请求,因为我的服务很火并且忘记了。PayloadValidatingInterceptor没有触发

<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" 
    xmlns:oxm="http://www.springframework.org/schema/oxm" 
    xsi:schemaLocation="http://www.springframework.org/schema/beans 
         http://www.springframework.org/schema/beans/spring-beans.xsd 
         http://www.springframework.org/schema/web-services 
         http://www.springframework.org/schema/web-services/web-services.xsd 
         http://www.springframework.org/schema/context 
         http://www.springframework.org/schema/context/spring-context.xsd 
         http://www.springframework.org/schema/oxm 
         http://www.springframework.org/schema/oxm/spring-oxm.xsd"> 

PayloadValidatingInterceptor is not firing at all: here is the configuration: 

    <sws:interceptors> 

    <bean id="validatingInterceptor"   
     class="org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor">  
     <property name="schema" value="/WEB-INF/erass-ingest.xsd"/>  
     <property name="validateRequest" value="true"/>  
     <property name="validateResponse" value="false"/> </bean> 

    </sws:interceptors> 

这是我的XSD的头:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.cbsa-asfc.gc.ca/erass/schema/ingest" xmlns:common="http://www.cbsa-asfc.gc.ca/erass/schema/common" targetNamespace="http://www.cbsa-asfc.gc.ca/erass/schema/ingest" elementFormDefault="qualified" attributeFormDefault="unqualified" version="0.4"> 
    <xs:import namespace="http://www.cbsa-asfc.gc.ca/erass/schema/common" schemaLocation="erass-common-types.xsd"/> 
    <xs:import namespace="http://www.cbsa-asfc.gc.ca/erass/schema/common" schemaLocation="erass-simple-types.xsd"/> 
    <xs:element name="IngestionData"> 

,这里是我的终点:

@Endpoint 
public class IngestionEndpoint { 

    private static final Logger logger = LoggerFactory.getLogger(IngestionEndpoint.class); 

    private static final String INGESTION_REQUEST = "IngestionData"; 

    private static final String NAMESPACE_URI = "http://www.cbsa-asfc.gc.ca/erass/schema/ingest"; 

    @Autowired 
    private IngestionService service; 

    public IngestionEndpoint() { 
     super(); 
    } 

    public IngestionEndpoint(IngestionService service) { 
     this.service = service; 
    } 

    @PayloadRoot(localPart = INGESTION_REQUEST, namespace=NAMESPACE_URI)  
    public void handleIngestRequest(@RequestPayload IngestionData data) { 
     try { 
      service.ingest(data); 
     } catch (Throwable t) { 
      logger.error("An error occurred ingesting data XXX", t); 
     } 
    } 
+0

你究竟在问什么? –

回答