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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T22:33:26+00:00 2026-05-19T22:33:26+00:00

I have a wcf service thats exposing a service using two endpoints. One endpoint

  • 0

I have a wcf service thats exposing a service using two endpoints. One endpoint is used for web service calls while the other is using rest.

Is there a way to determine from which endpoint the server functions are being called?

  • 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-19T22:33:27+00:00Added an answer on May 19, 2026 at 10:33 pm

    Actually, contrary to what I thought – it’s actually pretty easy to find out what endpoint the service was called on. In your service method, add these lines of code:

    OperationContext oc = OperationContext.Current;
    
    if(oc != null)
    {
        string wasCalledOn = oc.EndpointDispatcher.EndpointAddress.Uri.ToString();
    }
    

    But as I said : I would use this very wisely and “defensively” – don’t start changing service behavior based on what endpoint your method was called on – that would be very bad design!

    I tried this with several SOAP endpoints – not 100% sure how REST will be handled (but most likely the same or very similarly) – try it out!

    But for logging, this should work just fine!

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

Sidebar

Related Questions

I have a WCF service that is using a custom ServiceAuthorizationManager . The custom
I have created an OData/WCF service using Visual Studio 2010 on Windows XP SP3
I have a Windows Service that is exposing a WCF service thru a net.tcp
I have a WCF service that lives side-by-side with an MVC2 web site. I'd
We have a WCF service that is deployed to two servers. The bits are
I have a WCF service that's consumed via an iPhone application. All other methods
I wrote the most simple wcf service that have one method // return a+b
I have a WCF service that I have to reference from a .net 2.0
I have a WCF Service that should not enter the faulted state. If there's
I have a WCF service that is hosted in a windows application. The service

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.