How to consume multiple binding WCF Service method without mentioning the endpoint name
Currently I’m using BaciHttpBinding and WsHttpBindin for same Service. Before introduce the BasicHttpBing, My Client Windows app consuming the WsHttpBindin, so i didn't mention the endpoint name. After introduce the BasicHttpBinding i need to mension the Name of the endpoint in my client when it going to consume the Desired Service. My problem is, I have to change all the existing code with endpoint name. How can i overcome this situation or is there any method which i can set the default binding in config 开发者_运维问答level and it'll use when i didn't supply the endpoint name.
You can not define multiple endpoints on same address, assign two different address for both the bindings. You can leave the address blank in case of contracts and it will automatically points to the address of mex endpoint, which is being used for defining your metadata. Similarly you can BindingConfiguration tag to configure the bindings.
Do something like this, i am using binding configuration and transmode is streamed and using this binding configuration in my endpoints
<binding name="StreamBinding" closeTimeout="00:59:00" openTimeout="00:10:00"
sendTimeout="00:10:00" maxBufferPoolSize="700000000" maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647" transferMode="Streamed">
<readerQuotas maxStringContentLength="2147483647" maxArrayLength="1000" />
<reliableSession inactivityTimeout="02:00:00" />
<security mode="None"></security> </binding>
<endpoint address="" binding="netTcpBinding" bindingConfiguration="StreamBinding"
bindingName="" contract="DBSInterface.Common.IFileTransfer">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
精彩评论