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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:21:36+00:00 2026-05-27T03:21:36+00:00

Consider there are two web services Test1 and Test2 sitting in the same server

  • 0

Consider there are two web services Test1 and Test2 sitting in the same server in same project. There impl classes are Test1Impl and Test2Impl. Test1Impl contains definition of a method getDetails and Test2Impl contains a method addDetails.

Now I want to call addDetails in Test2Impl from getDetails in Test1Impl.
I get following ideas to implement this functionality

1) since these services impl classes are sitting in same project can I call it as a noramal java method like

new Test1Impl().addDetails(request)

this will break web service limitation.

2) I should make web service call to invoke that method. This will become nasty because the It will be hitting the network and making web service call to a service sitting in same server moreover in same project.

ServiceLocator.getTest1Services().addDetails(request);

3) implement same method in addDetails in Test1Impl as a private method.

public class Test1Impl{

public Response addDetails(Request request){
//
//
}
}

public class Test2Impl{

public Response addDetails(Request request){
//
//
}
}

This will be redundant of code and it will decrease the code standard.

Please help me which way to go,even new ideas are welcomed.

  • 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-27T03:21:36+00:00Added an answer on May 27, 2026 at 3:21 am

    I think you are mixing concerns in your design: you should refactor the business logic away from the web service interface/public exposure/transport logic. Perhaps have a DetailsService business service class (not a web service!) that has addDetails and getDetails methods that the services call as necessary. This way you will have no duplicated code and you are still keeping the read and write operations separate at the web service interface level.

    I like to keep my web service classes as small as possible and responsible only for passing information on to my business service layer. This means that if you were to add a GUI to your application that the business logic is already coded and you can just hook your new GUI into the DetailsService.

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

Sidebar

Related Questions

Consider these two classes mapped to the same table. One is readonly via mutable=false.
Please consider the following scenario, There are two web applications App1 & App2. A
I have this two sharepoint web application that resides on the same server with
Consider two web pages with the following in their body respectively: <body> <script> document.writeln('<textarea></textarea>')
Consider that there are two entities, Department and Employee, where in one department there
While working on one ASP.NET project hosted within web farm including two front ends
Consider these two function definitions: void foo() { } void foo(void) { } Is
I ran across a compilation issue today that baffled me. Consider these two container
Consider there is a QTablWidget and a QTextEdit. Both of them are in a
Consider that there is a bunch of tables which link to countries or currencies

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.