I have 3 projects in my solution. The first is an asp.net mvc project (as a client application), the other is a WCF service application , and the last is a workflow activity library . I added a link to the WCF service to link to the project workflow project and workflow added to asp.net mvc. When I used the wcf service in action and started the workflow from asp.net mvc, I get this error:
Could not find endpoint element named BasicHttpBinding_IService and contract IService in the client configuration of the ServiceModel section. Perhaps this is because the configuration file was not found by your application, or because no endpoint element matching this name can be found in the client element.
This is the contents of my app.config workflow library:
<configuration> <system.serviceModel> <bindings> <basicHttpBinding> <binding name="BasicHttpBinding_IService1" /> </basicHttpBinding> </bindings> <client> <endpoint address="http://localhost:30717/Service1.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService1" contract="Service1.IService1" name="BasicHttpBinding_IService1" /> </client> </system.serviceModel> </configuration>
And this is my wcf project web.config file:
<configuration> <appSettings> <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" /> </appSettings> <system.web> <compilation debug="true" targetFramework="4.5" /> <httpRuntime targetFramework="4.5"/> </system.web> <system.serviceModel> <behaviors> <serviceBehaviors> <behavior> <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/> <serviceDebug includeExceptionDetailInFaults="false"/> </behavior> </serviceBehaviors> </behaviors> <protocolMapping> <add binding="basicHttpBinding" scheme="http" /> </protocolMapping> <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /> </system.serviceModel> <system.webServer> <modules runAllManagedModulesForAllRequests="true"/> <directoryBrowse enabled="true"/> </system.webServer> </configuration>
And this is my contents of asp.net mvc web.config file:
<configuration> <appSettings> <add key="webpages:Version" value="3.0.0.0"/> <add key="webpages:Enabled" value="false"/> <add key="ClientValidationEnabled" value="true"/> <add key="UnobtrusiveJavaScriptEnabled" value="true"/> </appSettings> <system.web> <compilation debug="true" targetFramework="4.5"/> <httpRuntime targetFramework="4.5"/> </system.web> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35"/> <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0"/> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35"/> <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0"/> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/> <bindingRedirect oldVersion="1.0.0.0-5.2.3.0" newVersion="5.2.3.0"/> </dependentAssembly> </assemblyBinding> </runtime> <system.serviceModel> <bindings> <basicHttpBinding> <binding name="BasicHttpBinding_IService1" /> </basicHttpBinding> </bindings> <client> <endpoint address="http://localhost:30717/Service1.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService1" contract="ServiceTest.IService1" name="BasicHttpBinding_IService1" /> </client> </system.serviceModel> </configuration>
And this is my code to start the workflow in asp.net mpc controller:
wf.Activity1 mm = new wf.Activity1();//wf is reference added from workflow project mm.arg1 = "12".ToString() ; IDictionary<string, object> res = WorkflowInvoker.Invoke(mm); ViewBag.res = res["arg2"].ToString();
I figured out during the day and, unfortunately, did not get the result. Thanks for your guidance.
Edit: This is my project for additional help.
wcf wcf-binding workflow-activity
Farshid
source share