-
-
For preparing the Summer Classes of Class-A I stumbled on an exception which costs me a lot of time.
The situation was that I hosted a WF with Workflow services. The service is used by a client which is using a workflow for this also. The client workflow uses a SendActivity and the server a ReceiveActivity. (Just like the SequentialWorkflowService beta 2 sample). And like in the beta 2 sample I used a ServiceReference to connect the client to the service.
After configuring everything that is needed and running my projects, I received the following exception:
InvalidOperationException: Could not find a service endpoint with name 'ValidateCreditCardEndpoint' and contract type 'ClientWfHost.CreditCardServiceReference.IValidateCreditCard'
Well 'everyting' seems to be correct. The SendActivity its ServiceOperationInfo property is configured to the correct Interface. The ChannelTokens property its endpointName was correct and exists in the app.config. The app.config contains a single endpoint with a contract that correspondents to the name that is generated in reference.cs for the interface.
This name is configured on the ServiceContractAttribute with a ConfigurationName property which is located above the interface.
Ok found a difference here. This ConfigurationName has a different value than is configured on the SendActivity. This is how all 'references' to the interface looks like:
reference.cs: [ServiceContractAttribute(ConfigurationName = "CreditCardServiceReference.IValidateCreditCard")]
App.config contains an endpoint with: contract="CreditCardServiceReference.IValidateCreditCard"
and the SendActivity its ServiceOperationInfo property is ClientWfHost.CreditCardServiceReference.IValidateCreditCard
The solution to this problem was to make all 3 exactly the same. So I changed the ConfigurationName in reference.cs and contract in the app.config to ClientWfHost.CreditCardServiceReference.IValidateCreditCard. and voila it works like a charm. (I could also change the namespace of reference.cs)
Not the most elegant to change generated code but I think it's perfect after a lot of hours puzzling.
-
-
For the Summer Classes we use VS.NET beta 2 in a VPC image. For this reason I compiled the CopySourceAsHtml source against Beta 2.
Because Copysourceashtml is still not working nice in VPC's. I changed the source with Mike Glasers solution for copying source in VPC's.
You can download the source here (msi included)
The original source can be downloaded here