Announcement Announcement Module
Collapse
No announcement yet.
PayloadValidatingInterceptor throws cvc-elt.1: Cannot find the declaration of element Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • 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 org.springframework.ws.client.support.interceptor. 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.

    Thanks,
    Vandan

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

    Thanks,
    Anoop

    Comment


    • #3
      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.

      Comment


      • #4
        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:

        Code:
        <sws:interceptors>
              <bean id="validatingInterceptor"
                class="org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor">
            	 <property name="schemas">
            	 <list> 
            	 <value>/WEB-INF/myxsd1.xsd</value>
            	 <value>/WEB-INF/myxsd2.xsd</value>
            	 </list>
            	 </property>
            	 <property name="validateRequest" value="true"/>
            	 <property name="validateResponse" value="false"/>
        	  </bean>   
            </sws:interceptors>

        Comment


        • #5
          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.

          Comment

          Working...
          X