Throw a SoapException or Return a string?

Ask a Question related to ASP.NET Web Services, Design and Development.

  1. #1

    Default Throw a SoapException or Return a string?

    Our web service uses ComInterop to interact with a FoxPro COM dll. The COM
    dll assigns 0 - 20 "Error Codes" to a public property at the end of it's
    method. If the call to the COM dll was successfull, the COM dll assigns 0 to
    the public property. If there was an error, depending on the error, the COM
    dll assigns an integer between 1 and 20 to the public property. So I have
    code that checks the error number property after the call to the COM dll.

    The web method signature looks like this:

    Public Function PostProduct() As String

    I use to throw a soap exception if the error code was not 0. Non .Net
    clients had problems with this (I cannot recall why, this was written 3
    years ago). The web method returns a string so I now ( modified 6 months
    ago) simply return a string with something like "ERROR CODE = 10".

    A new client (web app written with PERL I think) has an issue with this so
    it's got me thinking. What's the best practice here? Throw a soapexception
    and put the error code in the exception details or return a string with the
    error code?

    Or, does it really matter?



    Greg Robinson

    Custom Data Systems, Inc.

    [url]www.cds-am.net[/url]


    Greg Robinson Guest

  2. Similar Questions and Discussions

    1. how to throw SoapException from HttpApplication
      Hi, When I throw a SoapException from HttpApplication the client which is a Soap Client is saying that it expected text\xml but got text\html....
    2. Does a SOAPException throw exit a function call?
      If I throw a SOAP exception such as Throw SoapException("An error occurred", SoapException.ClientFaultCode) from a webservice method then do I...
    3. How to return a string using RegEx
      I'm writing some regular expressions to find specific text in a string. Using REFind, returns the starting position, but I need to be able to...
    4. Web Services return string: An XML string
      We have a Web Service that returns an XML string. The client is getting the returned value with the angle brackets changed to &gt and &lt. It...
    5. Carraige return in string...
      How does one refer to a carraige return within a quoted string in Lingo? (For example if one wanted to use the carraige return character as the...
  3. #2

    Default Re: Throw a SoapException or Return a string?

    Well. I would normally recommends using Soap fault for web services
    error, or policy violations, but for expeced business funtion error,
    returning a meaning full error code is more appropriate, and i possible
    use XmlElement to describe the business error

    regards
    erymuzuan mustapa

    Greg Robinson wrote:
    > Our web service uses ComInterop to interact with a FoxPro COM dll. The COM
    > dll assigns 0 - 20 "Error Codes" to a public property at the end of it's
    > method. If the call to the COM dll was successfull, the COM dll assigns 0 to
    > the public property. If there was an error, depending on the error, the COM
    > dll assigns an integer between 1 and 20 to the public property. So I have
    > code that checks the error number property after the call to the COM dll.
    >
    > The web method signature looks like this:
    >
    > Public Function PostProduct() As String
    >
    > I use to throw a soap exception if the error code was not 0. Non .Net
    > clients had problems with this (I cannot recall why, this was written 3
    > years ago). The web method returns a string so I now ( modified 6 months
    > ago) simply return a string with something like "ERROR CODE = 10".
    >
    > A new client (web app written with PERL I think) has an issue with this so
    > it's got me thinking. What's the best practice here? Throw a soapexception
    > and put the error code in the exception details or return a string with the
    > error code?
    >
    > Or, does it really matter?
    >
    >
    >
    > Greg Robinson
    >
    > Custom Data Systems, Inc.
    >
    > [url]www.cds-am.net[/url]
    >
    >
    erymuzuan Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139