Quantcast
Channel: WCF, ASMX and other Web Services
Viewing all articles
Browse latest Browse all 555

WCF TestClient: How to display Fault Exception instead of "Failed to invoke the service."

$
0
0

Hi,

i wanna test my SOAP WCF Server.

So i start my Visual Studio Project from the Service1.svc File into the WCF Testclient.

public class Service1 : IService1
{

public string GetData(int value)
{
     return string.Format("You entered: {0}", value);
}

public string GetDataFail(int value)
{
     throw new FaultException("TestError");
}

}

The Soap Response from GetDataFail is:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header />
<s:Body>
   <s:Fault>
   <faultcode>s:Client</faultcode>
   <faultstring xml:lang="de-DE">TestError</faultstring>
   </s:Fault>
</s:Body>
</s:Envelope>

The Problem is that the WCF Test client cant handle the fault exception, instead it trows "Failed to invoke the service." ...

Is there any way to display the FaultException in the WCF Test Client? or is this intended behavior?


Viewing all articles
Browse latest Browse all 555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>