?
Solved

C# web reference and exception

Posted on 2011-03-11
4
Medium Priority
?
587 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

Technology Partners: 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

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month12 days, 14 hours left to enroll

777 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