SOAP Exception reply from Simon
"soap:Fault Richard has some thoughts on exceptions in ASP.NET WS. I think you really should send exception info as a soap:Fault, so that all the infrastructure pieces involved know something went wrong and can do the right thing" [simon fell]
Cool! I appreciate the pointer. My intent was to provide exception handling higher up the protocol stack. Somewhere around the "super-application" level. I'm foreseeing business logic of some sort being returned with ExceptionInfo. But that may never happen.
I was wondering if it's possible to pass my exception through soap:Fault?
Perhaps:
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Server</faultcode>
<faultstring>Server Error</faultstring>
<detail>
<ExceptionInfo Successful="boolean"
xmlns="http://com.stronglytyped.com/2003/ExceptionInfo">
<Message>some error message</Message>
<Source>Some.NET.Source</Source>
<StackTrace>A path; of execution;</StackTrace>
</ExceptionInfo>
</detail>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
I guess I'm learning this as I go here. I just found this tidbit at http://www.w3.org/TR/SOAP/#_Toc478383507:
"The detail element is intended for carrying application specific error information related to the Body element. It MUST be present if the contents of the Body element could not be successfully processed."
I highlighted the key to that quote that applies to my case. So would my proposal be SOAP kosher?

0 Comments:
Post a Comment
<< Home