Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Soap Fault from within a class - no Detail

Reply
Thread Tools

Soap Fault from within a class - no Detail

 
 
Nick Locke
Guest
Posts: n/a
 
      10-07-2006
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.


 
Reply With Quote
 
 
 
 
John Saunders
Guest
Posts: n/a
 
      10-08-2006
"Nick Locke" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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.



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

John


 
Reply With Quote
 
 
 
 
Nick Locke
Guest
Posts: n/a
 
      10-08-2006
When actor is non-blank, the behaviour is the same.

"John Saunders" <john.saunders at trizetto.com> wrote in message
news:(E-Mail Removed)...
> "Nick Locke" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>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.

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



 
Reply With Quote
 
Nick Locke
Guest
Posts: n/a
 
      10-08-2006
When Actor is non-blank, I see the same behaviour.

"John Saunders" <john.saunders at trizetto.com> wrote in message
news:(E-Mail Removed)...
> "Nick Locke" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>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.

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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SOAP error: Cannot map <class> to SOAP/OM Daniel Berger Ruby 0 02-02-2010 04:22 PM
ASp.net data binding: Master-detail-detail Frederik Borg ASP .Net Datagrid Control 0 06-09-2006 11:41 AM
Nested Class, Member Class, Inner Class, Local Class, Anonymous Class E11 Java 1 10-12-2005 03:34 PM
get custom fault detail type in to wsdl? Ryan Melville ASP .Net Web Services 0 04-21-2005 03:33 PM
Master Detail detail Arun Kumar Menon ASP .Net Datagrid Control 0 08-06-2003 08:04 PM



Advertisments