locked
Endpoint is not set in either code or config file. RRS feed

  • General discussion

  • I have created simple receive-reply sequence in workflow 4.0.
    I am using WorkflowServiceHost to host my workflow but getting error:

    "Endpoint is not set in either code or config file."

    Stack Trace:
    System.Activities.ValidationException was unhandled
      Message=Endpoint is not set in either code or config file.
      Source=System.ServiceModel.Activities
      StackTrace:
           at System.ServiceModel.Activities.Send.OnOpen(DeclaredEnvironment environment)
           at System.Activities.WorkflowElement.PerformOpen(ActivityDelegate delegateEnvironment)
           at System.Activities.WorkflowElement.OpenActivity(WorkflowElement activity, WorkflowElement parentActivity, DeclaredEnvironment parentEnvironment, ActivityDelegate delegateEnvironment)
           at System.Activities.ActivityUtilities.CallCallback(ProcessActivityCallback callback, WorkflowElement childActivity, WorkflowElement currentActivity, DeclaredEnvironment parentEnvironment, ProcessActivityTreeOptions options, ActivityDelegate delegateEnvironment, IdSpace idSpace)
           at System.Activities.ActivityUtilities.ProcessPublicMembers(WorkflowElement activity, WorkflowElement& nextActivity, Queue`1& activitiesRemaining, ProcessActivityTreeOptions options, ProcessActivityCallback callback)
           at System.Activities.ActivityUtilities.ProcessActivityTree(WorkflowElement activity, ProcessActivityTreeOptions options, ProcessActivityCallback callback)
           at System.Activities.WorkflowElement.Open(DeclaredEnvironment hostEnvironment)
           at System.Activities.WorkflowInstance.Initialize(WorkflowElement activity, IDictionary`2 inputs, SynchronizationContext syncContext, Guid instanceId, SymbolResolver symbolResolver)
           at System.Activities.WorkflowInstance..ctor(WorkflowElement activity, IDictionary`2 inputs, SynchronizationContext syncContext)
           at System.ServiceModel.Activities.WorkflowServiceImplementation.WalkActivityTree()
           at System.ServiceModel.Activities.WorkflowServiceImplementation.GetContractDescriptions()
           at System.ServiceModel.ServiceHostBase2.CreateDescription(IDictionary`2& implementedContracts)
           at System.ServiceModel.Activities.WorkflowServiceHost.CreateDescription(IDictionary`2& implementedContracts)
           at System.ServiceModel.ServiceHostBase.InitializeDescription(UriSchemeKeyedCollection baseAddresses)
           at System.ServiceModel.ServiceHostBase2.InitializeDescription(Service serviceDefinition, UriSchemeKeyedCollection baseAddresses)
           at System.ServiceModel.Activities.WorkflowServiceHost.Initialize(WorkflowElement activity, Uri[] baseAddress)
           at System.ServiceModel.Activities.WorkflowServiceHost..ctor(WorkflowElement activity, Uri[] baseAddress)
           at TestWorkflow.Program.Main(String[] args) in C:\Projects\TestWorkflow\TestWorkflow\Program.cs:line 84
           at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
           at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
           at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
           at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
           at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
           at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
           at System.Threading.ThreadHelper.ThreadStart()
      InnerException: 
    The XAML File:

    <p:Activity mc:Ignorable="" x:Class="TestWorkflow.Sequence1" xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities/design" xmlns:__Sequence1="clr-namespace:TestWorkflow;" xmlns:av="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:p="http://schemas.microsoft.com/netfx/2009/xaml/activities" xmlns:p1="http://schemas.microsoft.com/netfx/2009/xaml/servicemodel" xmlns:sad="clr-namespace:System.Activities.Debugger;assembly=System.Activities" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
      <p:Sequence sad:XamlDebuggerXmlReader.FileName="C:\Projects\TestWorkflow\TestWorkflow\Sequence1.xaml">
        <p:Sequence.Variables>
          <p:Variable x:TypeArguments="x:String" Name="SayhelloRequest" />
          <p:Variable x:TypeArguments="x:String" Name="SayhelloResponse" />
          <p:Variable x:TypeArguments="p1:CorrelationHandle" Name="handle" />
        </p:Sequence.Variables>
        <p1:Receive CanCreateInstance="True" CorrelatesWith="[handle]" OperationName="IHelloService.SayHello" ServiceContractName="IHelloService" ValueType="x:String">
          <p:OutArgument x:TypeArguments="x:String">[SayhelloRequest]</p:OutArgument>
        </p1:Receive>
        <p:Assign>
          <p:Assign.To>
            <p:OutArgument x:TypeArguments="x:String">[SayhelloResponse]</p:OutArgument>
          </p:Assign.To>
          <p:Assign.Value>
            <p:InArgument x:TypeArguments="x:String">["Hello " + SayhelloRequest]</p:InArgument>
          </p:Assign.Value>
        </p:Assign>
        <p1:Send CorrelatesWith="[handle]" OperationName="IHelloService.SayHello" ServiceContractName="IHelloService" ValueType="x:String">
          <p:InArgument x:TypeArguments="x:String">[SayhelloResponse]</p:InArgument>
        </p1:Send>
      </p:Sequence>
    </p:Activity>
    The code to host the workflow:
    using (WorkflowServiceHost host = new WorkflowServiceHost(new Sequence1(), new Uri("http://localhost:8980/Service")))
                {
                    host.Description.Behaviors.Add(new ServiceMetadataBehavior() { HttpGetEnabled = true });
                    host.Description.Behaviors.Find<ServiceDebugBehavior>().IncludeExceptionDetailInFaults = true;
                    host.AddServiceEndpoint("IHelloService", new BasicHttpBinding(), "");
    
                    host.Open();
                    Console.WriteLine("Service waiting at: " + "http://localhost:8980/Service");
                    Console.WriteLine("Press [ENTER] to exit");
                    Console.ReadLine();
                    host.Close();
                }
    looks like there is some issue with xaml.

    Thanks,
    Tuesday, June 16, 2009 6:10 AM

All replies


  • you are using a wrong activity for response message,
    - try to use the following:

        <p1:Receive x:Name="__ReferenceID0" CanCreateInstance="True" CorrelatesWith="[handle]" OperationName="SayHello" ServiceContractName="IHelloService" ValueType="x:String">
          <p:OutArgument x:TypeArguments="x:String">[SayhelloRequest]</p:OutArgument>
        </p1:Receive>
        
        ...

        <p1:SendReply Request="{x:Reference __ReferenceID0}" DisplayName="SendReplyToReceive" ValueType="x:String">
          <p:InArgument x:TypeArguments="x:String">[SayhelloResponse]</p:InArgument>
        </p1:SendReply>


    Thanks
    Roman

    p.s.
    The following are steps for creating a SendReply activity:
    1. delete activity Send
    2. right click on the activity Receive
    3. select Copy SendReply
    4. place your SendReply activity in the correct place
    5. populate activity SendReply
    Roman Kiss, MVP Connected System Developer
    Tuesday, June 16, 2009 7:07 PM


  • It is working. 

    Thanks,
    Wednesday, June 17, 2009 11:38 AM