Hier ist meine Antwort Umschlag:WCF typisierte Fehler und interner Server Fehlercode 500?
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<s:Fault>
<faultcode>s:Client</faultcode>
<faultstring xml:lang="en-US">The creator of this fault did not specify a Reason.</faultstring>
<detail>
<ServiceFault xmlns="http://schemas.datacontract.org/2004/07/Zagat.Services.FaultException" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<ReasonCollection xmlns:a="http://schemas.datacontract.org/2004/07/Zagat.Enterprise.Domain"/>
<ReasonMessage>Credentials are not valid</ReasonMessage>
</ServiceFault>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>
enter code here
Hier ist mein Rubrik:
HTTP/1.1 500 Internal Server Error
Date: Wed, 01 Jul 2009 17:55:33 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Content-Length: 564
Wie kann ich IIS erhalten einen 200 statt einer 500 zurück? Mein Code läuft auf dem Server, ich sende gerade einen Fehler an den Client zur Verarbeitung.
Daniel
Erhalten Sie diese Nachricht in einer ProtocolException? Ich hatte ein Problem mit diesen Ausnahmen, weil ich immer den HTML-Code in der Ausnahmebedingung erhielt. Jetzt nehme ich an, dass jede Protokollausnahme mit diesem HTML-Code kommt und ich parse es, um die echte Nachricht zu erhalten. http://stackoverflow.com/questions/998065/does-system-servicemodel-protocolexception-always-have-html-code-in-its-message – sebagomez