У меня есть xml-ответ от веб-службы:
<ns2:response xmlns:ns2="http://abc.com">
<ns2:msgHeader>
<ns2:empid>1234</ns2:empid>
<ns2:empname>John</ns2:empid>
</ns2:msgHeader>
<error>
<httpstatus>500</httpstatus>
<description>Error while processing the request.Please contact customercare</description>
</error>
</ns2:response>
Как мне отменять вызов, когда XML-схема находится в этом формате.<error>
является частью корневого элемента <response>
.
Я использую клиент Restful и использую resttemplate для отправки запроса на сервер.My applicationcontext.xml
использует org.springframework.http.converter.xml.MarshallingHttpMessageConverter
для сортировки и отмены сортировки XML-запросов и ответов.