.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Exposing service with multiple endpoints

Posted By:      Posted Date: October 04, 2010    Points: 0   Category :WCF

I have a service hosted as Windows Service. Now I want to make the same service availble via basicHttpBinding, wsHttpBinding.
So, I modified the my app.config as below using Microsoft Configuration editor. The WCF Service is already running on server (as Windows Service)

Note: The code (config) inside comments (below) is actual and the code inside "<!-- Newly .." is added later using config editor.
<!-- ORIGINAL -->
<!-- END - ORIGINAL -->

1. What I need to have in "baseAddresses" section for newly added endpoints (basicHttpBinding, wsHttpBinding)
2. Is newly added configuration correct?
3. Other than adding basicHttpBinding and wsHttpBinding, is there anything else that I need to do on "server"?

<?xml version="1.0" encoding="utf-8"?>
        <!-- ORIGINAL -->
        <behavior name="FirstServiceBehavior">
          <serviceMetadata httpGetEnabled="false" />
          <serviceDebug includeExceptionDetailInFaults="true" />

View Complete Post

More Related Resource Links

Best practice for WCF service exposing multiple client-specific endpoints?


Moving forward with re-designing a web service architecture using WCF, our team has been discussing how we want to expose the endpoints. Example: I have a standard endpoint that all users could use with the proper token, but I also have some number of endpoints that will instead use certificate security. All endpoints will ultimately use the same implementation, so this is really just different ways of getting in to the system.

The certificate endpoints will have to point to a specific certificate in the store so will only work for one specific client. The thought is that our standard service could live at http://mysite.com/MyService.svc and the certificate endpoints would be something like http://mysite.com/MyService.svc/Acme. The concern here is that I'm effectively putting our client list into our WSDL, which is not desirable.

What's the best practice here? Is there a way to direct multiple clients through a single certificate endpoint and get the cert on the code side (how would we know which client we're dealing with without a sp

Exposing WCF Service for multiple clients with the feature of multiple database support

i have ceated a WCF service and hosted it properly. now i want to Exposing this Service for multiple clients with the feature of multiple database support.In this functionality how could i do the proper multiple database management. what i am doing now:1. i am taking database string from the client.2. Then setting the refference of above provided database to the all functions call.ISSUE: if the mulitple clients calling the service at the same time and both are giving different database string then the database string provided by the clients is overlapping.....

Multiple services in REST Collection WCF Service?


After I create a "REST Collection WCF Service" project, it contains one service "service.svc". Can I add multiple services to this project? There must be a way to do so. Otherwise, it does not make sense to create one project for each service.


My question is how to add a new service to an existing "REST Collection WCF Service" project?


Thanks a lot.

WCF Needs? How to Communicate Multiple Contract via Single Service?

why it needs.   i have many business objects how could i serve to my web application via single service.   i have nearly 500 different business objects. how could contract implement into client web applicatoin.    

Exposing Web Service interfaces on a per-binding basis

Hi there, supposed I have a dual-homed system (with 2 nic ards) that are connected to 2 separate networks. Suppose one nic is bound to a public address (e.g. 63.xxx.xxx.xxx) and the other to a private network address (10.xxx.xxx.xxx). Is there a way for me to only expose a web services interface (e.g. foobar.asmx) on one of the bindings (e.g. 10.xxx.xxx.xxx), but not the other? I'm assuming this is a pretty typical scenario. Can someone please shed some light on this? Thanks,- K.  

Incorrect hostname in EndPoint location in WSDL for a service with multiple bindings and with multip

We have a WCF web service that is exposed through multiple bindings.  The site is  accessed through multiple IP Addresses/Hostnames (internet/intranet).  Some of the bindings use http transport while others use https transport. The web application is configured to use .NET 4.0 with multipleSiteBindingsEnabled="true" so that we shouldn't have problems with multiple ip addresses/hostnames. What we see is that when the WSDL is accessed using a http based URL (external), the hostnames in the endpoint addresses for http transport based bindings in WSDL are correct (ie, they use the hostname header from the request) while the hostnames in the endpoint addresses for https transport based bindings in the WSDL are incorrect (ie, they do not use the hostname header in the request - they seem to use the hostname from the first available binding in IIS for that scheme and end up with the local machine names/ip addresses in the URL).   We could work around by setting the external hostname/ip in the first binding in IIS for the respective scheme, but then WSDLs accessed from intranet clients would have wrong URLS now. This happens the other way around as well, ie, when the WSDL is accessed using https, the https based addresses are fine, but http addresses in the WSDL are not correct. It looks like hostname header is used only for WSDL endpoint addre

How to use single windows service to host multiple WCF Services instances (Each instance of WCF is i

How to use single windows service to host multiple WCF Services. I have a mutiple instance of same WCF service in different folder, each instance has unique service name and port. WCFService has reference to Reg-Free COM Reference, i have Native.WCFService.manifest in each folder. Ex: WCFService1 is in "C:\WCFService01\WCFService.dll, Native.OCWCFService.manifest, OCWCFService.dll.config WCFService2 is in "C:\WCFService02\WCFService.dll, Native.OCWCFService.manifest, OCWCFService.dll.config Now i need host above services from single Windows Service. I am trying to create AppDomain for each above WCFService Instance from Windows Service and then host. Its working if i register COM dll in the server using regsvr32, but when i un register COM dll, i am getting unable to load COM component .... This looks like AppDomain is not loading COM DLL and Manifest files. Its looks strange but we need it in this way because we have production and test environment in the same server. Everything works fine if create a seperate Windows Service for each WCFService Instance, but my manager wants single Windows Service :). Any help whould be really appreciated.  ravi kumar reddy

Multiple role providers for a service

Is it possible to hook multiple role providers with one service? I want client A  to connect to service A with roleprovidername A   & client B to connect to service A with roleprovidername B  Is this possible ? Thanks in advance.

Multiple net.tcp endpoints with different portnumbers on the same web site

I have multiple services that have to run under one website. Two of the services have a net.tcp endpoint. The addresses are formatted as follows: net.tcp://backend.ourcompany.com:9080/Product1/2010/09/Service1/Service1.svc net.tcp://backend.ourcompany.com:9081/Product1/2010/09/Service2/Service2.svc net.tcp://backend.ourcompany.com:9090/Product2/2010/09/Service2/Service2.svc Both services have their own Web.config. Currently both services have a different base address in their Web.config and a relative endpoint address. Everything worked ok with just the fist service installed, after installing the second I keep getting this error: 'This collection already contains an address with scheme net.tcp.  There can be at most one address per scheme in this collection. If your service is being hosted in IIS you can fix the problem by setting 'system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled' to true or specifying 'system.serviceModel/serviceHostingEnvironment/baseAddressPrefixFilters'.' Since the multipleSiteBindingsEnabled is only for http (why?) I tried getting it to work with the baseAddressPrefixFilters but I don't really understand how that would help me in my case. Is it possible what I'm trying to do here? Otherwise this would be a big fail of IIS, in a self-hosted environment I'm doing the same thing for years. I now want to migrate my ex

Multiple role providers for a service

Is it possible to hook multiple role providers with one service? I want client A  to connect to service A with roleprovidername A   & client B to connect to service A with roleprovidername B   Is this possible ?   Thanks in advance.

Deploy XBAP application with WCF Service Reference into multiple environments

Hi, we have a multiple environment setup (local, Development servers, QA servers, prod servers, etc.) and we are building an XBAP application that uses WCF Services to connect to databases.  We code and unit test everything locally and then deploy to our Development servers for more thorough unit testing.  The issue that we are having is that we don't see how to update the deployed XBAP application to use the Development server deployed WCF Service.  The only way we've been able to do this is by having to change the reference on my local machine, complie, and redeploy the XBAP.Question:  How do we configure a deployed XBAP's Service Reference to point to the same service on a different server than what it was originally compiled/deployed with?  (Like in some configuration file...NOTE: but we also don't see a config file after deploying the XBAP.)  We don't want to have to update the Service Reference for QA, Prod, Training, Stage, etc. on our local machines, compile and redeploy every time we need to migrate the application to a new environment.Thanks!

Create Multiple datafields in a Web Service

I have been working on this for awhile.  What I am trying to do is to retrieve the telephonenumber, mail and physicalDeliveryOfficeName from active directory  I have debugged it and it seems to work but when I connect to the data source in Infopath, there is no value.  Also, the data source has a group field called "choice."  I have no idea what that is.  I am using a contact select to fill out and the value of the AccountId will populate another field.  I use this field to choose the LoginName on the query and then run the query on the data source.  This should pupulate the email, phone, and location fields on the main data source.  Here is a sample of my code: Imports System.Web.Services Imports System.Web.Services.Protocols Imports System.ComponentModel Imports System.Net Imports Microsoft.sharepoint Imports Microsoft.SharePoint.WebControls Imports System.DirectoryServices Imports System.Data ' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. ' <System.Web.Script.Services.ScriptService()> _ <System.Web.Services.WebService(Namespace:="http://microsoft.com/webservices/")> _ <System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _ <ToolboxItem(False)> _ Public Class GetADProperty     Inherits System

Multiple endpoints in IIS

I am trying to setup my WCF service in IIS. I definately need to have the rest-ful service enabled using the webHttpBehavior and webHttp behavior. In addition, I want to keep the basicHttpBinding.   When I try this I get the following exception message:   A binding instance has already been associated to listen URI 'http://saslaptop/BE/Application.svc'. If two endpoints want to share the same ListenUri, they must also share the same binding object instance. The two conflicting endpoints were either specified in AddServiceEndpoint() calls, in a config file, or a combination of AddServiceEndpoint() and config.   Should this be possible?   Code Block <system.serviceModel> <behaviors> <endpointBehaviors> <behavior name="WebHttpBehavior"> <webHttp/> </behavior> </endpointBehaviors> </behaviors> <services> <service name="Application.Webservices.ApplicationService"> <endpoint behaviorConfiguration="WebHttpBehavior" binding="webHttpBinding" contract="Application.Webservices.IApplicationService"/> <endpoint binding="basicHttpBinding" contract="Application.Webservices.IApplicationService"/> </service> <service name="Application.Webservices.TypeAhead"> <endpoint behaviorConfiguration="WebHttpBehavior" bindin

Config Hosting multiple WCF services in one NT service


Hello there,


I've a question about hosting a service in a selfhosting scenario (not IIS or WAS).


For example, I have one WCFService with a config file (web.config). In this config file a system.serviceModel section exists, but also several appSettings.


Hosting in IIS is very simple. I created a svc file and voila, you can call the service. I do not have to place the configsettings of the WCFService into IIS.


Now I turn to host the WCFService in another host, a Windows NT service (or a win/console app).


Why do I have to place all of the WCFService configuration settings in the app.config of the NT Service? Why not just a reference to the physical path of the WCFService.


In the case of three WCFServices hosted by one NT Service, I have to place three web.config contents into the app.config of the NT Service. (Am I wrong? I hope so.)


tnx for reply!




Adding multiple users to a document library column by web service


I'm attempting to create some VB code to call a SharePoint Web Service to add a document and associated metadata to a document library. I can successfully add metadata to a text column but I'm having some problems getting multiple entries into a column which is specified to take multiple users (and does so when they are added manually) although I can get a single user in using the following snippet.

Dim info2 As MySharePoint.FieldInformation = New MySharePoint.FieldInformation()
info2.DisplayName = "Authors"
info2.InternalName = "Authors"
info2.Type = MySharePoint.FieldType.User
info2.Value = "1"

I'm hoping that someone will be able to advise me of the approach or syntax necessary to add multiple users to this Authors column e.g. Users 1 and 74. I note that

info2.Value = "1,74" or info2.Value = "1;74"

don't appear to work.

Configuration for STS with multiple endpoints


Hello all

I'm trying to configure an STS to have 2 endpoints. First endpoint accepts username client credentials and the second accepts the issued token as client credentials. So my client uses username and password to get a token, and when the token is about to expire I want to renew the token

I'm able to use the first endpoint but the second fails with error: Cannot find a token authenticator for the 'System.IdentityModel.Tokens.SamlSecurityToken' token type. Tokens of that type cannot be accepted according to current security settings.

I've tried to add custom service credentials but the are never hooked up.  

Accessing Multiple methods from a web service using web service task



When i am using an SSIS web service task, is it possible to get all the methods information to different tables.


Else if the above case is not possible, can i use multiple web service tasks with same http connection(.wsdl file) to access the web service for each method and then load the info to a table.(if i can do this, is there any performance issue)



ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend