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 6695713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:15:18+00:00 2026-05-26T06:15:18+00:00

This is my first try of develop a web service. Authentication is implemented by

  • 0

This is my first try of develop a web service. Authentication is implemented by sending login and password in the context of user request (used this example: http://www.mkyong.com/webservices/jax-ws/application-authentication-with-jax-ws/), and then calling autentication method from each WS method. But in this case what way of user notification about authentication failure is better? Throw an exception(SOAP fault)? Or there is some other better way?

P.S. sorry for my bad English

  • 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-05-26T06:15:18+00:00Added an answer on May 26, 2026 at 6:15 am

    Artem,

    SOAP faults are roughly analogous to program exceptions, so I would return a SOAP fault with

    • a distinct Fault Code (i.e. error number) and
    • a “vanilla” Fault String, which would be suitable for display to the user; and
    • Fault Detail containing “the techinical details”, such as the underlying exception and stack-trace.

    This gives you the best of both worlds, simplicity and flexibility. Just say, in the Service implementation you catch an AuthenticationFailureException and build a “SOAP fault response” with

    • FaultCode = 5,
    • FaultString = “Authentication Failed”, and
    • FaultDetail = “AuthenticationFailureException: blah blah\n <stacktrace>”

    So at programming time you’ve got everything you need to see EXACTLY what went wrong, and in production the service consumer (i.e. the presentation layer) is responsible for dealing with SOAP faults in order to present the user with an appropriate error message. Exactly what’s displayed to the user should NEVER be, especially in a fault scenario, be determined be the service. That is clearly the responsibility of the presentation layer.

    And one refinement… be sure to use a seperate exception-type (and soap-fault-code) for the scenario “the authentication service is currently unavailable”, so that users don’t fruitlessly keep retrying, worrying that they’ve forgotten there password, or been hacked, or whatever.

    This is a nice sucinct MSDN article on Using SOAP Faults, which is applicable both Java and .NET web-services.

    Cheers. Keith.

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

Sidebar

Related Questions

First off - hello, this is my first Stack Overflow question so I'll try
Code first: '''this is main structure of my program''' from twisted.web import http from
I did this: [User.first, User.last].to_xml and got this: <users type=array> <user> <created-at type=datetime>2010-03-16T06:40:51Z</created-at> <id
I try to develop my own little framework. For this, I'd like to read
This is my first try trying to use WCF, so I'm guessing I'm doing
I've long been wondering about this question; say I first try to grep some
This first lines work, and i get V(i) =V+QIN(i)-QOUT(i), but when i try to
I am trying to develop a system where this application allows user to book
this is my first time to post a question here, I will try to
In my StockTransaction.java, this runs first try{ FileOutputStream fos = new FileOutputStream(C:+File.separatorChar+transactions.dat); OutputStreamWriter osw

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.