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 / October 2006

Tip: Looking for answers? Try searching our database.

Soap Fault from within a class - no Detail

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nick Locke - 07 Oct 2006 22:42 GMT
I am trying to encapsulate logic within classes, so I have this:

Public Class StolenVehicleTemplate
   Private _Make As String
   Public Property Make() As String
       Get
           Make = _Make
       End Get
       Set(ByVal value As String)
           If value = "" Then
               ThrowException("E701", "Make cannot be blank")
           End If
           _Make = value
       End Set
   End Property
   Private Sub ThrowException(ByVal strCode As String, ByVal strMessage As
String)
       Dim node As System.Xml.XmlNode =
doc.CreateNode(System.Xml.XmlNodeType.Element, _
           SoapException.DetailElementName.Name, _
           SoapException.DetailElementName.Namespace)
' Node gets built here
       Dim objException As New SoapException("One or more mandatory
elements was not specified", _
                                   SoapException.ClientFaultCode, _
                                   "", _
                                   node)

       Throw objException
   End Sub
End Class

Whatever I try, I cannot persuade the detail element (node) to appear in the
exception.  When I use exactly the same code, but directly within a
webmethod rather than in a class that is referenced from the webmethod, it
all works fine.

Am I missing something?  I really want to be able to give the consumer a bit
more detail, without having to define it again and again, every time I use
the class.
John Saunders - 08 Oct 2006 03:14 GMT
>I am trying to encapsulate logic within classes, so I have this:
>
[quoted text clipped - 36 lines]
> bit more detail, without having to define it again and again, every time I
> use the class.

What happens when you use a non-blank actor parameter?

John
Nick Locke - 08 Oct 2006 10:00 GMT
When actor is non-blank, the behaviour is the same.

>>I am trying to encapsulate logic within classes, so I have this:
>>
[quoted text clipped - 40 lines]
>
> John
Nick Locke - 08 Oct 2006 10:01 GMT
When Actor is non-blank, I see the same behaviour.

>>I am trying to encapsulate logic within classes, so I have this:
>>
[quoted text clipped - 40 lines]
>
> John

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.