Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

C# web reference and exception

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
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…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

636 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