Итак, у меня есть клиент WCF, использующий веб-службу ASMX. Все работает нормально, кроме обработки исключений.
Если я должен получить (недоговорное) исключение FaultException, я получаю исключение CommunicationException.
Что может быть не так?
Вот соответствующие данные:
Ответ SOAP (похоже, соответствует спецификации):
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><soap:Code><soap:Value>soap:Sender</soap:Value></soap:Code><soap:Reason><soap:Text xml:lang="en">User not found or password is incorrect (User not found)</soap:Text></soap:Reason><soap:Node>Login</soap:Node><detail><ErrorInfo xmlns="http://tempuri.org/"><Area>Security</Area><ErrorCode>1</ErrorCode><Message>User not found or password is incorrect (User not found)</Message></ErrorInfo></detail></soap:Fault></soap:Body></soap:Envelope>
ex.Message (CommunicationException):
Server returned an invalid SOAP Fault. Please see InnerException for more details.
ex.InnerException.Message (XmlException):
End element 'Fault' from namespace 'http://www.w3.org/2003/05/soap-envelope' expected. Found element 'detail' from namespace ''. Line 1, position 444.