Hi guys
I've got a client app interacting with a remote service, which could be anywhere (I want the user to enter the IP address and port for the app to connect to and provide username/password for authentication).
My client app.config has a TCP endpoint as follows:
Code Snippet
<
endpoint address="net.tcp://localhost:4182/PCPLocalService"
binding="netTcpBinding" bindingConfiguration="netTcpEndpoint"
contract="IService1" name="netTcpEndpoint">
<
identity>
<
certificate encodedValue="AwAAAAEAAAAUAAAApT7D6........etc.........." />
</< FONT>identity>
</< FONT>endpoint>
And my client code specifies the endpoint like this:
Code Snippet
string remoteaddress = "net.tcp://192.584.34.32:4182/PCPLocalService" //this is actually generated from user-inputted IP address and Port.
proxy =
new Service1Client("netTcpEndpoint", remoteaddress);
proxy.ClientCredentials.UserName.UserName = username;
proxy.ClientCredentials.UserName.Password = password;
ds.Merge(proxy.tblUsers()); //this just fills a table if the credentials are returned as correct.
Now...if I take out the 'remoteaddress' from ("netTcpEndpoint", remoteaddress) it all works fine, but as soon as I put remoteaddress in, I get an identity error, as if the certificate encodedvalue is no longer used. But because I'm still specifying netTcpEndpoint as the endpoint name, shouldn't it also use this endpoint's identity, even though I'm throwing in a new remoteaddress to connect to instead of he default "net.tcp://localhost:4182/PCPLocalService"?