Khurram Ilyas
Khurram Ilyas

Reputation: 127

Soap Request FaultException.Detail is always empty

I am using a third party service & hence has no access to change anything from service side. I WSDL which I added as connect service.

The problem is that I have enabled the raw request & I can see error details in trace or debug log. But When I try to fetch details using following code it always return empty Detail Object.

try {
   // my code to call service
}
catch (System.ServiceModel.FaultException<Error[]> errors) {
    var err = Newtonsoft.Json.JsonConvert.SerializeObject(errors.Detail)
    Console.WriteLine(err);
}

Upvotes: 0

Views: 519

Answers (1)

VisualBean
VisualBean

Reputation: 5008

Edit: looks to be a duplicate of FaultException.Detail coming back empty

The problem was the visual studio didn't quite map out the ErrorDetail objects right. The ErrorDetail node is called "ErrorDetail", but the type generated for it is "ErrorDetailType." I edited the reference.cs class generated for each service I was using and added a TypeName:

Upvotes: 0

Related Questions