tags:

views:

130

answers:

2

I have a process, let's call it Process A, that is hosting a simple WCF service exposed though a basic Http binding. If I spin up that process I can then access the service from another process, Process B, with no problems.

However, my required use case isn't so simple. What I need to do is access the Service from a DLL that is hosting with Remoting. The Remoted DLL is spun up in a separate AppDomain by Process A and it is on the local machine.

When I call a method in the remoted DLL from Process A which in turn is supposed to call back to the WCF Service hosted in Process A the caller just hangs and after one minute I get a service timeout. The service code is never entered (a breakpoint that gets hit when calling it externally never is reached).

The fact that the Remoted DLL is able to create an instance of the client proxy class tells me (correct me if I'm wron here) that the configuration for the service is at least available in the Remoted client. It doesn't complain about missing configuration info or throw an exception like it does in the external client if I remove the service reference.

So I guess my question is multi-part. First, can a Remoted DLL call a WCF service in the first place (i.e. is all of the requisite infrastructure available to the client)? If it can, what might I be missing? And how does one go about debugging something like this? Debugging remoting is painful when it's a simple case - and this is not so simple.

One last thing - I can't change the fact that I'm in a process that is remoting the DLL and that remoted DLL needs to consume the service. It's a deeply entrenched part of the infrastructure of this app. I could, however, most the WCF service host to another process if it is of any use (and I might try that while waiting for any answers here).

A: 

The fact that the Remoted DLL is able to create an instance of the client proxy class doesn't sais that configuration is ok.

make sure you use the same base address as the server uses, and the same protocol, and security mode.

since you're on the same machine there should not be networking problem.

Dani
This is all on the same machine. Doesn't the fact that the class can be created tell me that some configuration is being read, not necessarily that it's correct, but at least that it's being found and loaded?
ctacke
I don't think WCF cares about "from where" the call arrives.why do you use a remoted dll from the same process of the WCF service ?
Dani
You can create a proxy with bad parameters, until you invoke something - it won't throw an exception.
Dani
The reason of why is a bit convoluted, but in short the DLL is one the application generates itself and then hosts. It's remoted so that it can be torn down and rebuilt at any time. Right now it's only local, though the application currently can consume DLLs hosted by the app running anywhere in the network.Again, so exception is thrown at all, it simply waits for 1 minute and gives a service timeout. It's as if it thinks it knows where the service is but is calling out to nowhere.
ctacke
add wcf tracing to the project, see how far the message goes if at all. and test the wcf service from another process to see that it is configured ok.
Dani
A: 

In the end we removed Remoting copmpletely. It was a lot more work, but was the right thing to do.

ctacke