Ask a Question related to ASP.NET Web Services, Design and Development.
-
Greg Robinson #1
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
-
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.... -
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... -
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... -
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 > and <. It... -
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... -
erymuzuan #2
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



Reply With Quote

