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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T20:55:12+00:00 2026-05-20T20:55:12+00:00

I am refactoring some SOAP and REST services. The SOAP services respond with the

  • 0

I am refactoring some SOAP and REST services. The SOAP services respond with the requested entity and nothing else. For example, a GET returns the XML representation of the entity that was requested. For errors, they throw standard exceptions. The REST services have identical behaviour.

I am modifying the REST services to throw WebApplicationExceptions and return proper http codes (e.g. http 201 for a successful post instead of always returning http 200). I am unfamiliar with SOAP, so I question what, if anything, needs to be changed.

What are the best practices for SOAP around:

1) Returning http codes (e.g. return a http 201 for POST/creation requests) for success and error cases? If so, how?

2) Throwing exceptions? Do you throw for all errors, including invalid data sent by the caller of the service? Should it be a SOAP exception or a WebApplicationException?

I am looking forward to your feedback.

  • 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-20T20:55:13+00:00Added an answer on May 20, 2026 at 8:55 pm

    SOAP is made to be functional independent of the transport layer. Though you aren’t using it, SOAP is capable of being sent through different protocols such as SMTP. Therefore, best practices would dictate that

    1) You shouldn’t be returning HTTP codes at all in your return message. In fact, you probably aren’t able to. Success/error messages are generally going to be defined in either a custom SOAP header or the response body (response body method is simpler).

    2) Every exception thrown by the web service should be a SOAP exception. This way, the client, whatever it may be, can interpret the SOAP exception and act appropriately.

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

Sidebar

Related Questions

Whilst refactoring some code I came across some getter methods that returns a std::string.
I'm new to tinkering with app.config and xml, and am currently doing some refactoring
Whilst refactoring some old code I realised that a particular header file was full
While refactoring some old code I have stripped out a number of public methods
Whilst refactoring some legacy C++ code I found that I could potentially remove some
I'm refactoring some PHP code and discovered that certain nested combinations of if ()
I am refactoring some MFC code that is littered with ASSERT statements, and in
I'm refactoring some old JavaScript code and there's a lot of DOM manipulation going
I'm refactoring some code I inherited from a long-gone developer, and I find this:
I'm refactoring some client-server code and it uses the terms Response, Result & Reply

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.