Announcement Announcement Module
No announcement yet.
PayloadValidatingInterceptor throws cvc-elt.1: Cannot find the declaration of element Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • PayloadValidatingInterceptor throws cvc-elt.1: Cannot find the declaration of element

    I have a 5 different WSDLs and their corresponding XSDs. I created a class WebservicePayloadValidator extended from PayloadValidatingInterceptor and override the handleResponseValidationErrors(..) to throw an exception in case of invalid response. Now it is keep throwing following exception:
    cvc-elt.1: Cannot find the declaration of element 'ser:AuthenticateUserNoLookupResponse'.
    I am just validating my responses. And I verified that all my WSDLs and XSDs are valid. I looked around for the solution but none of them worked for me. Can someone please give me some hint of its root cause and if possible solution too?? Let me know if someone need more code insight.


  • Vandan Mehta
    Thanks Adriano for the suggestion. But we already implemented this thing. And it works for 4 wsdls and xsds but it finds a problem in only one remaining wsdl and xsd. We are still trying to resolve that and will post the solution if we get one. And yes if we remove everything like you, everything works fine.

    Leave a comment:

  • Adriano_IoS
    I have checked Spring-WS documentation and I found this interesting part:

    "Note that the PayloadValidatingInterceptor can also accept multiple schemas using the schemas property. "

    So, according to this sample, I have found how to implement multiple interceptors.
    Check below code, look if it helps:

          <bean id="validatingInterceptor"
        	 <property name="schemas">
        	 <property name="validateRequest" value="true"/>
        	 <property name="validateResponse" value="false"/>

    Leave a comment:

  • Adriano_IoS
    Hi everybody,

    I am new to this forum.
    Anyway, I have your same issue and what I can actually say is that this problem occur when PayloadValidatingInterceptors are not correctly defined into *yourproject*-ws.servlet.xml.
    In the first time I've tried using only one .xsd and .wsdl and PayloadValidatingInterceptor worked fine, but now I have added a new .xsd and .wsdl and I have your same problem.
    If I remove all the validators the problem is gone but I want to keep all of my SOAP requests clean using the validatorInterceptor.

    Leave a comment:

  • anoop2811
    Hi ,
    Does anyone have an answer to this issue? Would greatly appreciate any help/pointers.


    Leave a comment: