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

  • Home
  • SEARCH
  • 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 6016153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:56:32+00:00 2026-05-23T02:56:32+00:00

What is the best/standard way to define a web service interface? For example, I

  • 0

What is the best/standard way to define a web service interface?

For example,

I have two class Car and Bus both of them extends Vehicle.

If I want to expose a create method for Car and Bus I have following options –

  1. public void create(Vehicle v);
  2. public void create(String type, Vehicle v);
  3. public void create(Car c); and public void create(Bus b);
  4. public void createCar(Vehicle v); and public void createBus(Vehicle v);
  5. public void createCar(Car c); and public void createBus(Bus b);

EDIT———————————

My main concern is of the above 5 options what is the standard way for a web service API. What is standard for java coding may not be standard for a webservice.

  • 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-23T02:56:32+00:00Added an answer on May 23, 2026 at 2:56 am

    If you are interested in the standard way then none of those is.
    Web services do not support operation overloading and it is prohibited in WS BP Profile
    WS BP

    4.5.3 Distinctive Operations
    
    Operation name overloading in a wsdl:portType is disallowed by the Profile. 
    

    This actually makes sense since the message mode (doc/lit) expects the operation name as the root of the message payload to do the dispatching.
    Additionally, you are talking about OO concepts but web services standards are meant as an integration technology (not bind to specific languages or platforms).
    In any case if you are expected to do that, you can implement overloading via tweeking at annotations and in your case, IMHO I think the best option would be 2 so that the consumer knows how to downcast it.

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

Sidebar

Related Questions

What is the best way to access a Rails 3 REST-ful web service, developed
Using the standard win32 api, what's the best way to detect more than one
I am relatively new to web services and am wondering what the standard best
I'm prototyping the best way to dynamically connect web parts at runtime. Essentailly, the
I have a Java web-app using standard web.xml and servlets. At the moment, I'm
What is the best way (standard) to display an error to the user in
Is there a standard way to handle response failure for chunked responses? I have
What's the best way (standard solution maybe) to build crash recovery into my application
Is there a standard way of using the jquery-ui icon sprite without attaching them
I am having a very hard time finding a standard pattern / best practice

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.