How to access SOAP 1.1 fault detail from WCF client (no fault contract)

后端 未结 1 1970
说谎
说谎 2021-01-05 16:52

I\'m accessing a SOAP 1.1 web service, and it\'s returning a fault. The web service does not define any fault contract in the WSDL as far as I can see. My WCF client maps

相关标签:
1条回答
  • 2021-01-05 17:10

    As detailed here: http://www.theruntime.com/blogs/jacob/archive/2008/01/28/getting-at-the-details.aspx

    you can use this workaround to obtain the details:

    } catch (FaultException soapEx)
    {    
        MessageFault mf = soapEx.CreateMessageFault();    
        if (mf.HasDetail)
        {    
            XmlDictionaryReader reader = mf.GetReaderAtDetailContents();    
            ...    
        }    
    }
    
    0 讨论(0)
提交回复
热议问题