Im trying to use xpath method of ResponseMatchers class to test an xpath expression exists on my web service response. But I'm getting a class cast exception as follows.Code:@Test public final void testUnlinkFail() throws Exception{ Source requestPayload = new StreamSource(unlinkFailRequest); Source responsePayload = new StreamSource(unlinkFailResponse); mockClient.sendRequest(withPayload(requestPayload)) .andExpect((ResponseMatcher)xpath("//ControlNumber[1]")); }
java.lang.ClassCastException: org.springframework.ws.test.server.XPathExpectatio nsHelperAdapter
cannot be cast to org.springframework.ws.test.server.ResponseMatcher .
Fair enough which makes sense. My problem is the spring web service 2.0 documentation
http://static.springsource.org/spring-ws/site/reference/html/server.html on section 5.7.3states that you can use xpath() method in this scenario. But it returns XPathExpectationsHelperAdapter object which cannot be cast to ResponseMatcher.


Reply With Quote