Results 1 to 4 of 4

Thread: PayloadValidatingInterceptor UndeclaredPrefix error

  1. #1
    Join Date
    Jun 2010
    Posts
    6

    Default PayloadValidatingInterceptor UndeclaredPrefix error

    Hello,
    I have been using PayloadValidatingInterceptor to validate received SOAP messages successfully. However, when trying to validate a new type of request I get the following validation error:

    spring-ws:ValidationError xmlns:spring-ws="http://springframework.org/spring-ws">UndeclaredPrefix: Cannot resolve 's1:data2' as a QName: the prefix 's1' is not declared.</spring-ws:ValidationError>
    <spring-ws:ValidationError xmlns:spring-ws="http://springframework.org/spring-ws">cvc-elt.4.1: The value 's1:data2' of attribute 'http://www.w3.org/2001/XMLSchema-instance,type' of element 's1:data' is not a valid QName.</spring-ws:ValidationError>
    <spring-ws:ValidationError xmlns:spring-ws="http://springframework.org/spring-ws">UndeclaredPrefix: Cannot resolve 's1:data2' as a QName: the prefix 's1' is not declared.</spring-ws:ValidationError>
    <spring-ws:ValidationError xmlns:spring-ws="http://springframework.org/spring-ws">cvc-attribute.3: The value 's1:data2' of attribute 'xsi:type' on element 's1:data' is not valid with respect to its type, 'QName'.</spring-ws:ValidationError>
    <spring-ws:ValidationError xmlns:spring-ws="http://springframework.org/spring-ws">cvc-complex-type.2.4.d: Invalid content was found starting with element 'value'. No child element is expected at this point.</spring-ws:ValidationError>

    This is my soap request:

    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:v1="http://validnamespace" xmlns:s1="http://validnamespace2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soap:Header/>
    <soap:Body>
    <v1:service>
    <s1:field1>
    <category>category1</category>
    </s1:field1>
    <s1:data xsi:type="s1:data2">
    <id>0001</id>
    <time>
    <time>2010-06-18</time>
    <value>0</value>
    </s1:field1>
    </v1:service>
    </soap:Body>
    </soap:Envelope>

    XSD element definition

    <xs:element name="data" type="s1:dataBase"/>

    <xs:complexType name="data2">
    <xs:complexContent>
    <xs:extension base="s1:dataBase">
    <xs:sequence>
    <xs:element name="value" type="xs:boolean"/>
    </xs:sequence>
    </xs:extension>
    </xs:complexContent>
    </xs:complexType>


    <xs:complexType name="dataBase">
    <xs:sequence>
    <xs:element name="id" type="xs:unsignedLong"/>
    <xs:element name="time" minOccurs="0"/>
    </xs:sequence>
    </xs:complexType>

    Does the PayloadValidatingInterceptor have problems with extended XML types?
    Thank you very much in advance.

  2. #2
    Join Date
    Jun 2010
    Posts
    6

    Default XML validation

    I was using AxiomSoapMessageFactory for unmarshaling. I have now changed it to SaajSoapMessageFactory and XML validation of complex data types is working smoothly. Anyone has any clue why? Thanks.

    Raul

  3. #3
    Join Date
    Nov 2010
    Posts
    5

    Default

    Hi, I had posted this question in a different thread. Didn't get any response. So, thought of reaching out to you since you have had success using the PayloadValidatingInterceptor. Could you please take a look at this?

    I'm trying to use the PayloadValidatingInterceptor to validate soap xml request.

    Here is the relevent code in spring application-context.xml:
    <bean class="org.springframework.ws.server.endpoint.mapp ing.PayloadRootAnnotationMethodEndpointMapping">
    <property name="interceptors">
    <list>
    <ref bean="validatingInterceptor" />
    </list>
    </property>
    </bean>

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

    I'm getting the following error:
    SRVE0100E: Did not realize init() exception thrown by servlet my-webservices: org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'org.springframework.ws.server.endpoint.mapping.Pa yloadRootAnnotationMethodEndpointMapping#0' defined in class path resource [my-webservices-context.xml]: Cannot resolve reference to bean 'validatingInterceptor' while setting bean property 'interceptors' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'validatingInterceptor' defined in class path resource [my-webservices-context.xml]: Invocation of init method failed; nested exception is javax.xml.validation.SchemaFactoryFinder$Configura tionError: Provider http\://www.w3.org/2001/XMLSchema=com.sun.org.apache.xerces.internal.jaxp. validation.xs.SchemaFactoryImpl not found .

  4. #4
    Join Date
    Nov 2010
    Posts
    5

    Default

    I'm probably either missing some required jars or using wrong version. Can anyone list the jars required to use this interceptor?

    These are the JARs in our application path:
    xws-security-2.0-FCS.jar
    activation-1.1.1.jar
    axiom-api-1.2.8.jar
    axiom-impl-1.2.8.jar
    bcel-5.1.jar
    bcprov-jdk14-1.43.jar
    castor-1.2.jar
    commons-httpclient-3.1.jar
    commons-logging-1.1.1.jar
    dom4j-1.6.1.jar
    ejb-2.1.jar
    isorelax-20030108.jar
    jaxb-api-2.1.jar
    jaxb-impl-1.0.6.jar
    jaxb-impl-2.1.5.jar
    jaxen-1.1.1.jar
    jaxp-api.jar
    jaxp-ri-1.4.1.jar
    jdom-1.1.jar
    jibx-bind-1.1.6a.jar
    jibx-run-1.1.6a.jar
    jms-1.1.jar
    log4j-1.2.15.jar
    relaxngDatatype-20020414.jar
    saaj-api-1.3.jar
    saaj-impl-1.3.2.jar
    servlet-api-2.5.jar
    spring-aop-2.5.6.jar
    spring-beans-2.5.6.jar
    spring-context-2.5.6.jar
    spring-core-2.5.6.jar
    spring-jdbc-2.5.6.jar
    spring-jms-2.5.6.jar
    spring-orm-2.5.6.jar
    spring-security-core-2.0.5.RELEASE.jar
    spring-tx-2.5.6.jar
    spring-web-2.5.6.jar
    spring-webmvc-2.5.6.jar
    spring-ws-1.5.9-all.jar
    spring-ws-1.5.9-sources.jar
    stax-api-1.0-2.jar
    wsdl4j-1.6.1.jar
    wstx-asl-3.2.7.jar
    xalan-2.7.1.jar
    xercesImpl-2.8.1.jar
    xml-apis-1.3.04.jar
    xmlbeans-2.4.0.jar
    XmlSchema-1.4.3.jar
    xmlsec-2.0.jar
    xom-1.1.jar
    xpp3-1.1.3.4.O.jar
    xsdlib-20060615.jar
    xstream-1.3.jar

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •