Axis2 AxisFault «Содержимое не разрешено в прологе». - Как я могу получить недопустимое XML-сообщение?
Иногда мы получаем неверные ответы XML при вызове веб-сервисов с помощью Axis2. Одной из причин, помимо других, может быть HTTP 500 на другом конце, что приводит к ответу, отличному от XML.
Для лучшей отладки было бы неплохо зарегистрировать HTTP-ответ.
Есть ли возможность получить фактический ответ HTTP в случае исключения AxisFault?
[...]
ServiceClient sender;
OperationClient mepClient;
sender = new ServiceClient (
axisConfiguration,
wsdlLocation,
new QName (
ns.getNamespaceURI(),
serviceName ),
null );
mepClient = sender.createClient (
new QName (
ns.getNamespaceURI(), action ) );
MessageContext messageContext = createMessageContext(method, attachments);
mepClient.addMessageContext (messageContext);
try {
mepClient.execute(true);
} catch (AxisFault fault) {
// the other side responded with non-xml content for some
// reason - how to get the actual response?
}