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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:38:08+00:00 2026-05-15T19:38:08+00:00

I am writing a Web Service to retrieve Invoice information from a database table.

  • 0

I am writing a Web Service to retrieve Invoice information from a database table. The specifics are as follows:
I intend to give InvoiceAgentId as input and retrieve PayerId,PayerName, EffDate and InvoiceAgentId.
Now,
1. In the InvoiceInfoSearch.asmx.cs file I have the WebMethod … GetInvoiceInfo
2. I have the DTO objects InvoiceInfoRequest and InvoiceInfoResponse
3. I have the BusinessLayer manager class InvoiceSearchmanager
4. I have the DAL InvoiceInfoDAL

The web method in point #1 instantiates the InvoiceSearchManager class and calls the GetInvoiceInfo method in the manager by passing the InvoiceInfoRequest. Then the manager method instantiates InvoiceInfoDAL and calls the GetInvoiceInfo method in the DAL by passing the InvoiceInfoRequest. In the DAL method the InvoiceInfoResponse is instantiated and populated with retrieved record set and then propagated back to web method.

My questions:
1. Can both the InvoiceInfoRequest and InvoiceInfoResponse DTO classes have the exact same members? In my case PayerId,PayerName, EffDate and InvoiceAgentId.
2. Is this layering correct? Can it be bettered?

  • 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-15T19:38:09+00:00Added an answer on May 15, 2026 at 7:38 pm

    From a layering perspective your description looks good. You can have the same method names in the DAL and Business layers. The problem is with the tight coupling. As you are describing it your web layer instantiates the business layer which instantiates the DAL layer.

    If this is the case how do you intend to unit test the business layer in isolation?

    I would suggest you introduce a level of abstraction to the DAL and business layers (by having them implement interfaces). Then the business layer implementation could take the DAL interface as a constructor argument (constructor injection) instead of having it instantiate the DAL.

    This level of abstraction will allow you to substitute the real DAL in the unit test by a mock object and test the business layer in isolation.

    All the plumbing (instantiations) will be done at the web tier.

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

Sidebar

Related Questions

I'm writing a web service, and I want to return the data as XHTML.
I am writing a web service in Java, and I am trying to figure
I am writing a C# client that calls a web service written in Java
I'm writing a mock of a third-party web service to allow us to develop
I'm writing a Windows service and need to make authenticated web requests. The service
Please suggest some good resources to start writing Java Web services.
I've been writing a few web services for a .net app, now I'm ready
Several frameworks for writing web-based desktop-like applications have recently appeared. E.g. SproutCore and Cappuccino
I writing a web site that uses Active Directory to validate users. I don't
Scenario: I'm currently writing a layer to abstract 3 similar webservices into one useable

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.