Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / November 2004

Tip: Looking for answers? Try searching our database.

Strange SOAP Exception

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Barry Christian - 16 Nov 2004 15:39 GMT
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
Dan Rogers - 18 Nov 2004 23:17 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
[quoted text clipped - 7 lines]
>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
>
[quoted text clipped - 27 lines]
>
>Thanks in advance

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.