[Fedora-suds-list] Dealing with exceptions from the web services

Donald W. Long donald.w.long at gmail.com
Wed May 26 19:25:48 UTC 2010


Message: 3 
Date: Tue, 25 May 2010 10:43:09 -0800 
From: "Joshua J. Kugler" <joshua at eeinternet.com> 
Subject: Re: [Fedora-suds-list] Dealing with exceptions from the web 
  services 
To: suds at lists.fedoraproject.org, "Donald W. Long" 
  <donald.w.long at gmail.com> 
Message-ID: <201005251043.09590.joshua at eeinternet.com> 
Content-Type: text/plain; charset="iso-8859-1" 

On Tuesday 25 May 2010, Donald W. Long elucidated thus: 
>I found that if the service returns a string value and the service 
>throws an exception i can look at the result and it will contain 
>'soap:Server', but if the service returns void then you can not tell 
>if you have an error or not. 
>
>
>But what I am really trying to figure out, is how do you see what 
>exception the service has thrown. 
>
>You may noticed that I am using the WindowsHttpAuthenticated, this is 
>required for access to the server that is running the web services. 

If you are not seeing a suds.WebFault raised then the service is not 
raising a SOAPFault, and thus is returning error information to you 
other ways. If the service does not raise a SOAPFault on errors, then 
you will have to wrap the call and raise an exception if an error 
condition is returned. 
  
I understand the above but we did a test with C#, below is some of the 
code and we get a soap error.
  
  
public partial class _Default : System.Web.UI.page
{
     protected void Page_load(object sender, EventArgs e)
     {
         SAWebServices ws = new SAWebService();
         try
         {
             ws.GetBuildLocation(string.Empty);
         }
         catch (SoapException se)
         {
             Response.Write(se.Detail);
         }
     }
}
  
the above code will get a SoapException if an empty string is sent to 
GetBuildLocation.  The service is written in .NET ASP.  From what I 
have been told, Microsoft always converts the exception into a Soap 
Exception.  When we also use perl we get an exception for the client 
code but not using python and suds.  Should the SoapException be 
something else?
  
We are at a loss on this one and not sure how to continue using suds 
with Python.  Given all other languages that we use, C# and perl we get 
an exception from it.  With Python and suds we only get a string that 
says Soap:Server.  
  
What type of exception should we throw for the web service, and what I 
do not understand is given all these other languages and packages work, 
what is the difference between suds and what they are doing.  Most of 
the developers in my area feel that suds is not handling exceptions 
correctly, me, I am not sure, I am new at soap.
  
If you have any recommendations on what we should do then please let us 
know.  We would really like to move to Python and suds.
  
Have a nice day 
  
Donald W. Long
Email:    Donald.W.Long at thelongsfamily.com
Skype:  Donald.W.Long
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.fedoraproject.org/pipermail/suds/attachments/20100526/9d003153/attachment.html 


More information about the suds mailing list