Solved

C# web reference and exception

Posted on 2011-03-11
4
579 Views
Last Modified: 2012-05-11
Hi,
Java web service is passing me a custom exception: NoIncomeException, which is a soapfault. That is actually a soapexception. I've to create a custom exception that exposes that exception to all my .Net project.

Problem is that only way I can catch that exception is
catch(SoapException ex)
{
if ex.message.contains("No Income Exception");
}

so I've to build my customeexception such that this condition is tested. I've no idea how to do that. Can somebody help please?
0
Comment
Question by:vivekj2004
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 19

Expert Comment

by:daveamour
ID: 35115734
if ex.message.contains("No Income Exception")
{
    throw new MyCustomException();
}

Where MyCustiomException is one you write inheriting from Exception

Is that what you need?
0
 

Accepted Solution

by:
vivekj2004 earned 0 total points
ID: 35129009
Thanks daveamour,
       for this solution, exception ex has to inherit from soapexception, and when I do that, I get an error saying that custom exceptions have to inherit from System.Exception.

Can you provide a solution for this problem
0
 

Author Comment

by:vivekj2004
ID: 35460587
I didn't get any meaningful response, so I accepted my answer as solution.
0
 

Author Closing Comment

by:vivekj2004
ID: 35496436
I don't have acceptable answer to this question.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question