jfkrueger119584

Hello,

I am trying to use a WCF service from within a Sequential Workflow Library project. I am using this WCF service within several other projects and it works fine. I am using the exact same configuration and proxy file in my Workflow project that I am using in the other projects that are consuming this service, but I am always getting this error when I try to instantiate the Service from within my wofkflow project.

"Could not find endpoint element with name 'FTPService' and contract 'IFTPService' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this name could be found in the client element."

Here is my endpoint configuration on the client (workflow library):

<client>

<endpoint address="net.tcp://server:15000/FTPService/FTPServiceTCP"

binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IFTPService"

contract="IFTPService" name="FTPService" />

</client>

As you can see, there IS an endpoint with the name "FTPService" and contract "IFTPService". I am referencing the exact same system.servicemodel.dll that I am referencing in my other pojects that do work and am using the exact same configuration & proxy file too. This leads me to believe that it is a problem with the workflow project, not the WCF service.

What's going on here and how can I make calls to a WCF service from within a Workflow library

Thanks!



Re: Windows Workflow Foundation Unable to use WCF service from Workflow Project

Kavita Kamani - MSFT

Since you're creating a workflow library project, I am wondering if your config file is getting renamed correctly to the appropriate app.config / exe.config file. Could that be the case




Re: Windows Workflow Foundation Unable to use WCF service from Workflow Project

jfkrueger

Definitely sounds plausible. It is just a normal app.config in the project, should it be named something else I can access the config file to get my connection strings though..

Thanks for the reply!





Re: Windows Workflow Foundation Unable to use WCF service from Workflow Project

jfkrueger

I deleted my app.config and added the WCF reference through the "Add Service Reference" menu item rather than adding the proxy class directly to my project. It created another app.config which gave me the exact same results. Here is the client section it created for me in my new app.config:

<client>

<endpoint address="net.tcp://server:15000/FTPService/FTPServiceTCP"

binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IFTPService"

contract="FTPService.IFTPService" name="NetTcpBinding_IFTPService" />

</client>


Only difference is that it has fully qualified the Interface on the contract..but it still gives the exact same error.




Re: Windows Workflow Foundation Unable to use WCF service from Workflow Project

Kavita Kamani - MSFT

Since you're adding this config to the library project (you said workflow sequential library project), what is the executable that you're running Thats what I was referring to - is this app.config being renamed to that appropriate foo.exe.config




Re: Windows Workflow Foundation Unable to use WCF service from Workflow Project

jfkrueger

There is a file called "LCNWorkflows.dll.config" in my bin/debug folder. The assembly name of my project is "LCNWorkflows" as well as the root namespace.

Is that what you were referring to This is the only other *.config file in my project..

Thanks again!





Re: Windows Workflow Foundation Unable to use WCF service from Workflow Project

Kavita Kamani - MSFT

Yeah is the config file you generate also the foo.exe.config file that's in the bin/debug folder assuming you're hosting in an executable. If you're hosting in IIS, is your web.config correct




Re: Windows Workflow Foundation Unable to use WCF service from Workflow Project

jfkrueger

I edited my last post but you had already replied, sorry! The only other config file is in my bin/debug and is called LCNWorkflows.dll.config.

Is it supposed to be LCNWorkflows.exe.config I am hosting in IIS and I'm pretty sure the web.config is correct there. Do I need the service reference in the Host even though it is already in the actual workflow

Thanks again for your quick post.





Re: Windows Workflow Foundation Unable to use WCF service from Workflow Project

jfkrueger

actually, it's just in the Bin folder. There is no Bin\Debug folder, but there is an obj\debug folder.





Re: Windows Workflow Foundation Unable to use WCF service from Workflow Project

Kavita Kamani - MSFT

Interesting, not sure why that is. Wherever your .exe is, is the config file there

If yes, then I am out of ideas Smile






Re: Windows Workflow Foundation Unable to use WCF service from Workflow Project

jfkrueger

I'm confused..there is no .exe file. It is a SequentialWorkflowLibrary project, so it only generates a .dll file.

Thanks again for your help.





Re: Windows Workflow Foundation Unable to use WCF service from Workflow Project

Kavita Kamani - MSFT

You cannot run a library - you can only run an executable or you can use the library in a host like IIS. Now I am confused about how you're trying to use this library. Can you clarify end to end what you're trying to do after creating this library project






Re: Windows Workflow Foundation Unable to use WCF service from Workflow Project

jfkrueger

I have a website that hosts the workflow. An event is raised from the website which kicks off several activities in the workflow. One of the activities needs to access a WCF service but I always get the errror noted above. This is an error in the workflow library project, not in the host (website). I didn't go into the hosting environment because it shouldn't matter as the error is occurring in the code in the WorkflowLibrary project.

Not sure if this is related or not but it is another strange thing about the app.config file in my WorkflowLibrary project. I can access the connection strings just fine that have been there since the project was started, but any new connection strings in the app.config cannot be accessed. I always get an "object reference not set to an instance of an object" error.





Re: Windows Workflow Foundation Unable to use WCF service from Workflow Project

Kavita Kamani - MSFT

Ok I just heard that there is a bug in VS in the March CTP - I am not sure if you're using the March CTP or not. Could you be running into this

For any projects that use app/web.config, it is necessary to rename appname.exe.config to appname.config.






Re: Windows Workflow Foundation Unable to use WCF service from Workflow Project

jfkrueger

I have the following installed:

  1. Visual Studio 2005 extensions for .NET Framework 3.0 (WCF & WPF), November 2006 CTP
  2. Visual Studio 2005 Extensions for Windows Workflow Foundation
  3. .NET Framework 3.0

I'll check my website though and see if it is creating an appname.exe.config.

Thanks!