I am developing an application using WPF and WCF. This app on the server side will need for WCF services hosted in IIS6 to communicate with WCF services that are hosted as Windows services on the same server / or network. Also the WCF services hosted in IIS6 has to communicate with the WPF client apps that will be installed on computers that are not in the same network as the server/s. Right now I am creating small test apps so I can figure out how to get everything to play.
I have sucessfully made calls from WPF to WCF, hit the data store from WCF and passed back complex types to WPF with security etc. That part works great, however trying to do a client callback is kicking my butt. I have walked through several tut's on the net with no sucess. and I think I know why. All of the tut's that I have found are client/server where the client and the server are on the same network. Another problem I have is that my development machine is behind a router (on a different network than the server, and this is the same type of environment all of the users of this app will have) so when I create the custom binding on the client and set the ClientBaseAddress (as follows);
Dim mybinding
As WSDualHttpBinding =
New WSDualHttpBinding(WSDualHttpSecurityMode.Message)
mybinding.Security.Message.ClientCredentialType = MessageCredentialType.Certificate
mybinding.Security.Message.NegotiateServiceCredential =
True
Dim context
As InstanceContext =
New InstanceContext(
New CallBack())
Dim myHost
As String = Dns.GetHostName()
Dim ipEntry
As IPHostEntry = Dns.GetHostByName(myHost)
Dim add
As IPAddress() = ipEntry.AddressList
mybinding.ClientBaseAddress =
New Uri(
"http://" + add(0).ToString() +
":" +
"4000" +
"/")
_client =
New TCallSvcClient(context)
_client.Endpoint.Binding = mybinding
the address will be a non public IP in the 192.168.x.x range and the server cant call the client back with that address. I figured that I may try to forward a port in the router config but I could not get that to work either. So I have (3) questions:
1) how do I configure client callbacks using wsDualHttpBinding (This is the only binding I can use) when the client and server are on different networks and the clients will be behind a router?
2) Is it possible for IIS 6.0 hosted WCF services to communicate with Windows hosted WCF services (on the same server / or network) via net.tcp binding? (duplex calls here)
3) Can anyone give or point me to some example implementations of the above?
Oh and right now I receive either a timeout exception (which I think is due to te real exception being dropped because of the one way op) or the 405 method not allowed exception (Fiddler says: The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt access.)
I thank you in advance.