Hello.
I'm working on app using SWS.
PayloadValidatingInterceptor fails to validate the following request:
which is based on schema:Code:... <sch:transport xmlns:sch="http://www.invito.ru/ws/schemas"> <sch:transportType code="0"/> <sch:details xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="sch:Flight"> <sch:commonTransportInfo>String</sch:commonTransportInfo> <sch:airline code="0"/> <sch:departureAirports> <sch:airport code="0"/> </sch:departureAirports> </sch:details> </sch:transport> ...
Stacktrace:Code:<xsd:element name="transport" nillable="true" minOccurs="0"> <xsd:complexType> <xsd:sequence> <xsd:element name="transportType" type="ReferenceItem"/> <xsd:element name="details" type="TransportDetails"/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:complexType name="TransportDetails" abstract="true"> <xsd:sequence> <xsd:element name="commonTransportInfo" type="xsd:string"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="Flight"> <xsd:complexContent> <xsd:extension base="TransportDetails"> <xsd:sequence> <xsd:element name="airline" type="ReferenceItem" minOccurs="0"/> <xsd:element name="departureAirports" type="ArrayOfAirportCode" minOccurs="0"/> </xsd:sequence> </xsd:extension> </xsd:complexContent> </xsd:complexType>
Code:2007-08-15 15:40:19,880 WARN [org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor] - XML validation error on request: UndeclaredPrefix: C annot resolve 'sch:Flight' as a QName: the prefix 'sch' is not declared. 2007-08-15 15:40:19,880 WARN [org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor] - XML validation error on request: cvc-elt.4.1: The va lue 'sch:Flight' of attribute 'http://www.w3.org/2001/XMLSchema-instance,type' of element 'sch:details' is not a valid QName. 2007-08-15 15:40:19,880 WARN [org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor] - XML validation error on request: cvc-type.2: The typ e definition cannot be abstract for element sch:details. 2007-08-15 15:40:19,880 WARN [org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor] - XML validation error on request: UndeclaredPrefix: C annot resolve 'sch:Flight' as a QName: the prefix 'sch' is not declared. 2007-08-15 15:40:19,880 WARN [org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor] - XML validation error on request: cvc-attribute.3: Th e value 'sch:Flight' of attribute 'xsi:type' on element 'sch:details' is not valid with respect to its type, 'QName'. 2007-08-15 15:40:19,880 WARN [org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor] - XML validation error on request: cvc-complex-type.2. 4.d: Invalid content was found starting with element 'sch:airline'. No child element is expected at this point.
I can switch off the validation and this message is getting unmarshelled with JAXB without errors.
I've found the same issue with validation on this forum and the advise was to change the parser version.
The problem is that i don't know how to change the parser version with pom.
I'm using spring-ws-1.0-rc3-SNAPSHOT, jdk 1.5.0_12, jetty 6.1.5
My pom:
How to specify a version of xerces/xalan here?Code:<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>ru.invito.ws</groupId> <artifactId>invito-ws</artifactId> <packaging>war</packaging> <version>1.0-SNAPSHOT</version> <name>invito-ws Spring-WS Application</name> <url>http://www.springframework.org/spring-ws</url> <build> <finalName>invito-ws</finalName> <plugins> <plugin> <groupId>com.sun.tools.xjc.maven2</groupId> <artifactId>maven-jaxb-plugin</artifactId> <executions> <execution> <goals> <goal>generate</goal> </goals> </execution> </executions> <configuration> <schemaDirectory>${basedir}/src/main/webapp/WEB-INF</schemaDirectory> <generateDirectory>src/main/java</generateDirectory> <includeSchemas> <includeSchema>**/*.xsd</includeSchema> <includeSchema>**/*.dtd</includeSchema> </includeSchemas> <excludeSchemas> <excludeSchema>test*.xsd</excludeSchema> <excludeSchema>FS_OTA_Ping.xsd</excludeSchema> </excludeSchemas> <includeBindings> <includeBinding>*.xjb</includeBinding> </includeBindings> <strict>true</strict> <verbose>true</verbose> <extension>true</extension> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.5</source> <target>1.5</target> </configuration> </plugin> <plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>maven-jetty-plugin</artifactId> </plugin> </plugins> </build> <dependencies> <!-- Spring-WS dependencies --> <dependency> <groupId>org.springframework.ws</groupId> <artifactId>spring-xml</artifactId> <version>1.0-rc3-SNAPSHOT</version> </dependency> <dependency> <groupId>org.springframework.ws</groupId> <artifactId>spring-ws-core</artifactId> <version>1.0-rc3-SNAPSHOT</version> </dependency> <dependency> <groupId>org.springframework.ws</groupId> <artifactId>spring-ws-core-tiger</artifactId> <version>1.0-rc3-SNAPSHOT</version> </dependency> <dependency> <groupId>org.springframework.ws</groupId> <artifactId>spring-oxm</artifactId> <version>1.0-rc3-SNAPSHOT</version> </dependency> <dependency> <groupId>org.springframework.ws</groupId> <artifactId>spring-oxm-tiger</artifactId> <version>1.0-rc3-SNAPSHOT</version> <scope>runtime</scope> </dependency> <dependency> <groupId>org.springframework.ws</groupId> <artifactId>spring-ws-security</artifactId> <version>1.0-rc3-SNAPSHOT</version> </dependency> <!-- /Spring-WS dependencies --> <!-- Spring dependencies --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>2.0.5</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-beans</artifactId> <version>2.0.5</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aop</artifactId> <version>2.0.5</version> <scope>runtime</scope> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> <version>2.0.5</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>2.0.5</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-remoting</artifactId> <version>2.0.5</version> </dependency> <!-- /Spring dependencies --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.1</version> <scope>test</scope> </dependency> <!-- O/X Mapping + XJC dependencies --> <dependency> <groupId>javax.xml.bind</groupId> <artifactId>jaxb-api</artifactId> <version>2.1</version> </dependency> <dependency> <groupId>com.sun.xml.bind</groupId> <artifactId>jaxb-impl</artifactId> <version>2.1.3</version> <scope>runtime</scope> </dependency> <!-- /O/X Mapping + XJC dependencies --> <dependency> <groupId>javax.xml.soap</groupId> <artifactId>saaj-api</artifactId> <version>1.3</version> <scope>runtime</scope> </dependency> <dependency> <groupId>com.sun.xml.messaging.saaj</groupId> <artifactId>saaj-impl</artifactId> <version>1.3</version> <scope>runtime</scope> </dependency> </dependencies> <repositories> <repository> <id>spring-s3</id> <name>Springframework Maven SNAPSHOT Repository</name> <url>http://s3.amazonaws.com/maven.springframework.org/snapshot</url> </repository> <repository> <id>java.net</id> <name>java.net Maven Repository</name> <url>https://maven-repository.dev.java.net/nonav/repository</url> <layout>legacy</layout> </repository> </repositories> </project>


Reply With Quote
