Environment - Vista Ultimate, VS2008
Taking the WCF Example from Chapter 5...
If you create the host using code, the next step in the book is to create the client.
In the client you Service Reference the TCP and NamedPipe endpoints.
The issue is, when you create the endpoints in code, you are able to create the service references in the client.
If you change the Host from code to using the appl.config file and run it, the client still runs correctly with no changes.
Now, you delete the Service Reference in the Client and try to re-create the Service References and it fails with the following errors.
TCP:
Metadata contains a reference that cannot be resolved: 'net.tcp://localhost:8000/TcpBinding'.
The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:04:59.7920055'.
An existing connection was forcibly closed by the remote host
If the service is defined in the current solution, try building the solution and adding the service reference again.
NamedPipe:
Metadata contains a reference that cannot be resolved: 'net.pipe://localhost/NetNamedPipeBinding'.
There was an error reading from the pipe: The pipe has been ended. (109, 0x6d).
There was an error reading from the pipe: The pipe has been ended. (109, 0x6d).
If the service is defined in the current solution, try building the solution and adding the service reference again.
So...You return to the host, hookup the hard coded end points, fire it off, and you are then again able to create the Service References in the client.
It appears it needs an endpoint such as...
<endpoint contract="IMetadataExchange" binding="netTcpBinding" address="net.tcp://localhost:8000/TcpBinding/mex" />
<endpoint contract="IMetadataExchange" binding="netNamedPipeBinding" address="net.pipe://localhost/NetNamedPipeBinding/mex" />
This does not do the trick.
Anyone know the trick to make this Host expose the endpoints for the client to reference?
As a note, this would be a good addition to the WCF book as an issue a developer might run into when creating their own WCF service, host, client. The steps above would be exactly what they would need to produce this error. Then the result and reasons, etc.
Thank you.
Richard Loba
[email protected]