Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8593339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:57:56+00:00 2026-06-11T23:57:56+00:00

I have a JAX-WS based application that I am developing. I generate WSDL from

  • 0

I have a JAX-WS based application that I am developing. I generate WSDL from the server using wsgen and then build the client library using wsimport. I am writing my own custom exceptions to throw with my method calls. The code is structured as follows.

Custom Exception Class:

@WebFault(faultBean = "com.mysite.FaultBean")
public class MyCustomException extends Exception {
  private FaultBean faultInfo;

  //Getters/Setters/Constructors...
}

Custom Fault Bean:

public class FaultBean {
  private String message;
  private List<String> messages;

  //Getters/Setters/Constructors...
}

I then throw MyCustomException from my methods in my web service endpoint. When I call one of my web service methods and it throws an exception the client is getting a SOAPFaultException instead of MyCustomException. Why is the custom exception not getting used?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T23:57:58+00:00Added an answer on June 11, 2026 at 11:57 pm

    So, after a bit of investigation it turns out the exceptions that were being thrown as a SOAPFaultException were not coming from where I thought they were. They actually were not thrown as MyCustomException. So, to solve this for all cases I took advantage of Spring AOP and created an Around aspect to wrap all of my calls to the web service implementation layer.

    In this aspect I catch any exception thrown and wrap it in a MyCustomException before rethrowing it. My client can then handle the exception properly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have developed a REST application server based on RESTEasy (JAX-RS). I have a
I have a problem when generating java classes from WSDL using JAX-RPC wscompile ANT
I have a wsdl and I'd like to generate jax-ws type Java source from
I have a WSDL file for a web service. I'm using JAX-WS/wsimport to generate
I have a JAX-RS based ( RESTEasy ) REST server that uses Java annotations
I am using jax-ws (cxf) based SOAP1.1 api in my springMVC based application. I
We have a webservice running on Websphere 6.1 using the IBM JAX-RPC based webservices.
I'm creating a Spring WS client. I have a huge WSDL from a third-party
I have a JAX-RPC web service that I am attempting to consume using Spring.
I have a server using jax-rpc framework hence uses SOAP1.1 encoding. I got a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.