I have a Web.API site that talks to a local WCF WF Service Hosted in AppFabric/IIS 8.0 - Server 2012
The MVC controller has a service reference to the local .xamlx service
Here is the ServiceModel Part of the Service config:
<system.serviceModel>
<bindings>
<netNamedPipeBinding>
<binding name="NetNamedPipeBinding.IVoiceService" maxBufferSize="65536" maxConnections="100">
<security mode="None" />
</binding>
</netNamedPipeBinding>
</bindings>
<client>
<endpoint address="net.pipe://localhost/Main.xamlx" binding="netNamedPipeBinding"
bindingConfiguration="NetNamedPipeBinding_.IVoiceService"
contract="Voice.IVoiceService" name="NetNamedPipeBinding.IVoiceService" />
</client>
WCF WF Service Model section:
<system.serviceModel>
<bindings>
<netNamedPipeBinding>
<binding name="pipeSecurityOff" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions" maxReceivedMessageSize="65536">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport protectionLevel="None" />
</security>
</binding>
</netNamedPipeBinding>
</bindings>
<services>
<service behaviorConfiguration="MEX" name="Main">
<endpoint address="MEX" binding="mexHttpBinding" contract="IMetadataExchange" />
<endpoint address="MEX" binding="mexTcpBinding" contract="IMetadataExchange" />
<endpoint address="" binding="netNamedPipeBinding" bindingConfiguration="pipeSecurityOff" contract="NYRA.IVoiceService" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="MEX">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
<sqlWorkflowInstanceStore instanceCompletionAction="DeleteAll" instanceEncodingOption="None" instanceLockedExceptionAction="NoRetry" connectionStringName="ApplicationServerWorkflowInstanceStoreConnectionString" hostLockRenewalPeriod="00:00:30" runnableInstancesDetectionPeriod="00:00:05" />
<workflowInstanceManagement authorizedWindowsGroup="AS_Administrators" />
<workflowUnhandledException action="AbandonAndSuspend" />
<workflowIdle timeToPersist="00:00:00" timeToUnload="00:00:00" />
<etwTracking profileName="Troubleshooting Tracking Profile" />
<serviceThrottling maxConcurrentCalls="256" maxConcurrentSessions="800" maxConcurrentInstances="928" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true">
</serviceHostingEnvironment>
So, If you noticed the MaxConnections property is missing from the binding:
<binding name="pipeSecurityOff" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions" maxReceivedMessageSize="65536">
If I open up IIS 8.0 and Edit the Endpoint, goto the performance tab and change max connections from 10 to 100. it updates the web.config with:
<binding transactionFlow="false" maxBufferSize="65536" maxConnections="100" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" hostNameComparisonMode="StrongWildcard" transactionProtocol="OleTransactions" transferMode="Buffered" name="pipeSecurityOff" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00">
Now I get an error:
This error (HTTP 500 Internal Server Error) means that the website you are visiting had a server problem which prevented the webpage from displaying.
The logs show:
<Message>There is no compatible TransportManager found for URI 'net.pipe://myuritemp/Main.xamlx/System.ServiceModel.Activities_IWorkflowInstanceManagement'. This may be because you have used an absolute address that points outside of the virtual application, or the binding settings of the endpoint do not match those that have been set by other services or endpoints. Note that all bindings for the same protocol should have the same settings in the same application.</Message>
It seems you should be able to change this property:
http://msdn.microsoft.com/en-us/library/system.servicemodel.netnamedpipebinding.maxconnections.aspx
Why does adding this attribute to the binding crash the server? How can I increase the named pipe connections for better performance?
Related
I wrote a self-hosted WCF service. When I run the server and the client, the client connects well. I rewrote the server as a Windows service. Now when I run the server and the client, the server is started, but the client fails upon request method with the error
The HTTP request is unauthorized with client authentication scheme 'Negotiate'. The authentication header received from the server was
Windows service is registered as LocalSystem. Server config:-
<system.serviceModel>
<services>
<service behaviorConfiguration="MyServiceTypeBehaviors" name="UCSService.UCSModule">
<endpoint address="" binding="basicHttpBinding" contract="UCSService.IUCSModule">
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
<host>
<baseAddresses>
<add baseAddress="http://localhost:9000/"/>
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="MyServiceTypeBehaviors">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpEndpointBinding" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
</system.serviceModel>
Client config:-
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpEndpointBinding" closeTimeout="00:01:00"
openTimeout="00:00:30" receiveTimeout="00:10:00" sendTimeout="00:01:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxBufferSize="65536" maxReceivedMessageSize="65536"
textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"
messageEncoding="Text">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://192.168.101.123:9000/" binding="basicHttpBinding"
bindingConfiguration="BasicHttpEndpointBinding" contract="UCSModuleClient.IUCSModule"
name="BasicHttpBinding_UCSModule" />
</client>
</system.serviceModel>
As I understand it, the main problem is that the server has become the service, but how to solve the problem I do not know. How can I resolve this problem?
Can you use google in the following fashion: https://www.google.com.bh/search?q=The+HTTP+request+is+unauthorized+with+client+authentication+scheme+%27Negotiate%27.&oq=The+HTTP+request+is+unauthorized+with+client+authentication+scheme+%27Negotiate%27.&aqs=chrome..69i57.384j0j7&sourceid=chrome&es_sm=93&ie=UTF-8
Possible solution: Try to run the service with the user Administrator
I have followed all the steps on showing the metadata using the config file but I still received
Metadata publishing for this service is currently disabled
Below is my config file.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IService1" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<services>
<service name="RedPillJob_Raw.Service1" behaviorConfiguration="MyServiceTypeBehaviors">
<endpoint address="http://xxx.xxx.xxx.xxx/DanRaw/Service1.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService1"
contract="IService1" name="BasicHttpBinding_IService1" />
<endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="MyServiceTypeBehaviors" >
<serviceMetadata httpGetEnabled="true" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
I am so lost now, I hope somebody can help me.
The only thing I'd suggest is trying setting your endpoint address to the actual URL your client devices would connect to, for instance:
http:/ /CatDogMouse:6666/DanRaw/Service1
I don't see any examples of MEX with a .SVC address.
I have a service with two contracts that I want to use with tcp binding. The service configuration files is this:
<system.serviceModel>
<bindings>
<netTcpBinding>
<binding name="ServiceDocumentos" transferMode="Streamed"
maxBufferSize="67108864"
maxReceivedMessageSize="67108864" maxBufferPoolSize="67108864"
closeTimeout="00:00:10"
openTimeout="00:00:10" receiveTimeout="00:20:00"
sendTimeout="00:01:00" maxConnections="100"/>
<binding name="ServiceCore" transferMode="Buffered"
maxBufferSize="67108864"
maxReceivedMessageSize="67108864" maxBufferPoolSize="67108864"
closeTimeout="00:00:10"
openTimeout="00:00:10" receiveTimeout="00:20:00"
sendTimeout="00:01:00" maxConnections="100"/>
</netTcpBinding>
<basicHttpBinding>
<binding name="ServiceDocumentos" messageEncoding="Mtom" transferMode="Streamed" />
<binding name="ServiceCore" messageEncoding="Mtom" transferMode="Buffered" />
</basicHttpBinding>
<wsDualHttpBinding>
<binding name="ServiceDocumentos" messageEncoding="Mtom"/>
<binding name="ServiceCore" messageEncoding="Mtom"/>
</wsDualHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="CMMSService" name="GTS.CMMS.Service.Service">
<endpoint binding="netTcpBinding" bindingConfiguration="ServiceDocumentos"
name="ServiceDocumentos" contract="GTS.CMMS.Service.IServiceDocumentos"
address="ServiceDocumentos/">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address ="net.tcp://localhost:6000/CMMSService/ServiceCore/"
binding="netTcpBinding" bindingConfiguration="ServiceCore"
name="ServiceCore" contract="GTS.CMMS.Service.IService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"
listenUriMode="Explicit">
</endpoint>
<host>
<baseAddresses>
<add baseAddress="http://localhost:8500/CMMSService" />
<add baseAddress="net.tcp://localhost:8501/CMMSService" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="CMMSService">
<serviceMetadata httpGetEnabled="True"/>
<serviceDebug includeExceptionDetailInFaults="True" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
And the client configuration file is:
<system.serviceModel>
<bindings>
<netTcpBinding>
<binding name="ServiceDocumentos" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00" hostNameComparisonMode="StrongWildcard"
maxBufferSize="3670016" maxBufferPoolSize="524288" maxReceivedMessageSize="3670016"
transferMode="Streamed">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="65536"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
</binding>
<binding name="ServiceCore" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00" hostNameComparisonMode="StrongWildcard"
maxBufferSize="2097152" maxBufferPoolSize="524288" maxReceivedMessageSize="2097152"
transferMode="Buffered">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="65536"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</netTcpBinding>
<basicHttpBinding>
<binding name="ServiceDocumentos" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false"
bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="3670016" maxBufferPoolSize="524288" maxReceivedMessageSize="3670016"
messageEncoding="Mtom" textEncoding="utf-8" transferMode="Streamed"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="65536"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
</binding>
<binding name="ServiceCore" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false"
bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="2097152" maxBufferPoolSize="524288" maxReceivedMessageSize="2097152"
messageEncoding="Mtom" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="65536"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
<wsDualHttpBinding>
<binding name="ServiceDocumentos" messageEncoding="Mtom"/>
<binding name="ServiceCore" messageEncoding="Mtom"/>
</wsDualHttpBinding>
</bindings>
<client>
<!--<endpoint address="net.tcp://localhost:8501/CMMSService/ServiceDocumentos/"
binding="netTcpBinding" bindingConfiguration="ServiceDocumentos"
contract="IServiceDocumentos" name="ServiceDocumentos" />
<endpoint address="net.tcp://localhost:8501/CMMSService/ServiceCore/"
binding="netTcpBinding" bindingConfiguration="ServiceCore"
contract="IService" name="ServiceCore" />-->
<endpoint address="net.tcp://localhost:8501/CMMSService/ServiceDocumentos/"
binding="netTcpBinding" bindingConfiguration="ServiceDocumentos"
contract="IServiceDocumentos" name="ServiceDocumentos" />
<endpoint address="net.tcp://localhost:6000/CMMSService/ServiceCore/"
binding="netTcpBinding" bindingConfiguration="ServiceCore"
contract="IService" name="ServiceCore" />
</client>
</system.serviceModel>
I am doing test with different bindings. For example, if for one contract, IServiceDocumentos I use tcp and for the other contract, the main contract I use wsDualHttpBinding, all works fine. Ican use the two contracts.
If I use tcp for the two contracts, then I get the error tcp 10061.
I try to use a individual full address for each contract, because I guess that the problem could be the use of the same port, but the problem persists. However, if I use a full individual address for each endpoint, that works if I use different bindings.
Also I try to star the service tcp port sharing (the service in windows XP) and the problem is not solved.
I try to disabled the firewall, but this not solve the problem.
Thanks.
EDIT:
I use the follwing command when I have the service running:
netstat -ona || find "6000"
I get the following information:
TCP 0.0.0.0:6000 0.0.0.0 LISTENING 2690
So I think that the por is opened and listening.
I think you have defined your addressees of your service endpoints in the wrong way.
You don't have to use a different port for each tcp address as long as you enable port sharing.
That is achieved by using Net.TCP Port Sharing Service which is available on any .NET 3.0 installation. By default the service is not enabled so you have to enable it yourself. Related to how to enable Net.TCP POrt Sharing Service check the follwoing link: http://msdn.microsoft.com/en-us/library/ms733925.aspx.
I have a service with a basichttp binding and I am trying to add a net.tcp binding to it. here is how the config looks like:
<services>
<service behaviorConfiguration="ServiceBehavior" name="Some.L.E.S.BusinessService">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IBusinessService"
contract="Some.L.E.Services.IBusinessService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="/BusinessService.svc" binding="netTcpBinding" bindingConfiguration="netTcpBinding_IBusinessService" contract="Some.L.E.Services.IBusinessService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<host>
<baseAddresses>
<add baseAddress="http://localhost:63487/"/>
<add baseAddress="net.tcp://localhost/" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehavior">
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
<!-- Start of HostServices client configurations -->
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IBusinessService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="2147483647" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None" realm="" />
</security>
</binding>
</basicHttpBinding>
<!-- RSF -->
<netTcpBinding>
<binding name="netTcpBinding_IBusinessService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
hostNameComparisonMode="StrongWildcard"
maxBufferSize="2147483647" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647"
transferMode="Buffered">
<readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None"/>
</security>
</binding>
</netTcpBinding>
</bindings>
I start this service up in VS2010 and I am trying to connect to it from another VS2010 project. However I get the following error:
Could not find a base address that matches scheme net.tcp for the endpoint with binding NetTcpBinding. Registered base address schemes are [http]
Most solutions seem to recommend changes to the web.config in IIS virtual directory. But my Service is not hosted in IIS.
Any help will be much appreciated.
Thank you,
GM
I have the following config for my WCF service:
<system.serviceModel>
<services>
<service behaviorConfiguration="After.BehaviourConfig" name="ServiceInstancingDemo.Service1">
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="After.BindingConfig"
name="After.ConfigName" contract="ServiceInstancingDemo.IService1">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://rb-t510/NGCInstancing/Service1.svc" />
</baseAddresses>
</host>
</service>
</services>
<bindings>
<wsHttpBinding>
<binding name="After.BindingConfig" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" maxBufferPoolSize="524288111" maxReceivedMessageSize="524288111" allowCookies="false">
<security mode="None" />
</binding>
</wsHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="After.BehaviourConfig">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
<serviceThrottling maxConcurrentCalls="30" maxConcurrentInstances="2147483647" maxConcurrentSessions="30" />
</behavior>
</serviceBehaviors>
</behaviors>
I am able to call the service with the following client code:
NGC.Service1Client ngc = new NGC.Service1Client();
var taskA = Task<string>.Factory.StartNew(() => ngc.WaitThenReturnString(5));
this.listBox1.Items.Add(taskA.Result);
The config for the client that calls the service is as follows:
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="Before" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00" maxBufferPoolSize="524288111"
maxReceivedMessageSize="524288111" allowCookies="false" />
<binding name="After" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00" maxBufferPoolSize="524288111"
maxReceivedMessageSize="524288111" allowCookies="false">
<security mode="None" />
</binding>
<binding name="WSHttpBinding_IService1" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="None">
<transport clientCredentialType="Windows" proxyCredentialType="None"
realm="" />
<message clientCredentialType="Windows" negotiateServiceCredential="true" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="http://rb-t510/NGCInstancing/Service1.svc"
binding="wsHttpBinding" bindingConfiguration="Before" contract="NGCInstance.IService1"
name="Before" />
<endpoint address="http://rb-t510/NGCInstancing/Service1.svc"
binding="wsHttpBinding" bindingConfiguration="After" contract="NGCInstance.IService1"
name="After" />
<endpoint address="http://rb-t510/NGCInstancing/Service1.svc"
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IService1"
contract="NGC.IService1" name="WSHttpBinding_IService1">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</client>
</system.serviceModel>
Problem is, I want to add another endpoint that will execute the same functionality but with a different behavior. To do this, I think I'm going to need to pass a string of the enpointConfigurationName to the constructor in the line=new NGC.Service1Client. I don't know what string I need to pass - I would have expected it to be the endpoint configuration name "After.ConfigName" but I tried this and got the following error message:
Could not find endpoint element with name 'After.ConfigName' and contract 'NGC.IService1' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this name could be found in the client element.
Can anyone please help?
You would pass the value of the name attribute of the corresponding client endpoint you would like to use. For example if you wanted to use the third endpoint:
new NGC.Service1Client("WSHttpBinding_IService1")