RE: Strange SOAP Exception

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Dan Rogers (danro_at_microsoft.com)
Date: 11/18/04


Date: Thu, 18 Nov 2004 23:17:47 GMT

Hi Barry,

If I understand what you are trying to do, you want to place some custom
details in the Detail element inside of a SOAP fault. If this is all you
want to do (since SOAP does not allow you to define new fault types), I'd
just use the basic exception mechanism already provided and copy specific
details from a class with your own desired sturcture into the detail
element of the exception before returning the exception.

Does that make sense?

Dan Rogers
Microsoft Corporation
--------------------
>From: barry@riverdragon.com (Barry Christian)
>Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
>Subject: Strange SOAP Exception
>Date: 16 Nov 2004 07:39:25 -0800
>Organization: http://groups.google.com
>Lines: 29
>Message-ID: <523978c.0411160739.1439eb89@posting.google.com>
>NNTP-Posting-Host: 63.88.133.223
>Content-Type: text/plain; charset=ISO-8859-1
>Content-Transfer-Encoding: 8bit
>X-Trace: posting.google.com 1100619566 23616 127.0.0.1 (16 Nov 2004
15:39:26 GMT)
>X-Complaints-To: groups-abuse@google.com
>NNTP-Posting-Date: Tue, 16 Nov 2004 15:39:26 +0000 (UTC)
>Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!news-out.cwi
x.com!newsfeed.cwix.com!border1.nntp.dca.giganews.com!nntp.giganews.com!news
glorb.com!postnews.google.com!not-for-mail
>Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.aspnet.webservices:26604
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
>
>I get the following error when thowing a SOAP Exception:
>The type System.Web.Services.Protocols.SoapException in Assembly
>System.Web.Services, Version=1.0.5000.0, Culture=neutral,
>PublicKeyToken=b03f5f7f11d50a3a is not marked as serializable
>
>However, SOAPException most certainly is marked as serializable. It
>inherits from SystemException which is. Why would I get this error?
>
>I have seen this some already in newsgroups but with no posted answer.
>
>I am getting this error in two cases. In once case I am using the MS
>Exception Handler Application Block. IN the other I do not use that at
>all, but instead just throw a SoapException. I follow the sample code
>for creating it to the letter. You can see a mockup of it below:
>
> SoapException MySoapException;
> XmlDocument errordoc = new XmlDocument();
> XmlNode detail = errordoc.CreateNode(XmlNodeType.Element,
> SoapException.DetailElementName.Name,
> SoapException.DetailElementName.Namespace);
>
> detail.InnerText = "A detailed error message goes here";
> MySoapException = new SoapException("Code Location goes here",
> SoapException.ServerFaultCode,
> Context.Request.Url.AbsoluteUri, detail, null );
>
> throw MySoapException;
>
>Thanks in advance
>



Relevant Pages

  • RE: Global Exception Handling
    ... Exceptions thrown by an XML Web service method created using ASP.NET are ... sent back to the client in the form of a SOAP fault. ... XML element contains details such as the exception string and the ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • Is this a valid SOAP fault response ..
    ... Is the following a valid SOAP Response for a SOAP Fault? ... not as an exception object. ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • Re: exception responses to ASP.Net soap services
    ... public class Service1: System.Web.Services.WebService ... SOAP error packet? ... Is there support in the framework for returning a soap exception packet, ... Any uncaught exception is translated into a SOAP Fault. ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • Re: SoapExtension doesnt work with HttpGet
    ... The SoapExtension capability exposes the parsing and formatting of SOAP ... HttpGet, then the extension never gets activated. ... will get invoked in the case of an unhandled application exception. ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: SoapExtension doesnt work with HttpGet
    ... HttpGet too saying it will used 80% of the time rather than SOAP!! ... > Summary of Http Handlers and Http Modules in ASP.NET ... > will get invoked in the case of an unhandled application exception. ...
    (microsoft.public.dotnet.framework.webservices)