2012-02-09 1 views
1

soap 메시지를 기반으로하는 Content를 사용하여 상관 관계를 가져 오려고하는 WF4 WCF 서비스가 있습니다.WF4 WCF Correlation 및 MessageContract가 작동하지 않습니다.

나는 다음과 같은 오류 메시지가 점점 오전 : 여기

<Message>A correlation query yielded an empty result set. Please ensure correlation queries for the endpoint are correctly configured.</Message> 
      <StackTrace><![CDATA[at System.ServiceModel.Activities.Dispatcher.CorrelationKeyCalculator.Calculator`1.CalculateKeys(T target, Message messageToReadHeaders, InstanceKey& instanceKey, ICollection`1& additionalKeys) 
    at System.ServiceModel.Activities.Dispatcher.ControlOperationInvoker.GetInstanceKeys(OperationContext operationContext, InstanceKey& instanceKey, ICollection`1& additionalKeys) 
at System.ServiceModel.Activities.Dispatcher.ControlOperationInvoker.ControlOperationAsyncResult.EnsureInstanceId() 
at System.ServiceModel.Activities.Dispatcher.ControlOperationInvoker.ControlOperationAsyncResult.Process() 
at System.ServiceModel.Activities.Dispatcher.ControlOperationInvoker.ControlOperationAsyncResult..ctor(ControlOperationInvoker invoker, Object[] inputs, IInvokeReceivedNotification notification, TimeSpan timeout, AsyncCallback callback, Object state) 
at System.ServiceModel.Activities.Dispatcher.ControlOperationInvoker.InvokeBegin(Object instance, Object[] inputs, IInvokeReceivedNotification notification, AsyncCallback callback, Object state) 
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc) 
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc) 
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc) 
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)]]></StackTrace> 

나의 클래스입니다

[MessageContract(IsWrapped = false)] 
public class ClaimObj 
{ 
    [MessageHeader] 
    public string CorrelationId { get; set; } 

    [MessageBodyMember] 
    public string InstanceId { get; set; } 
} 
여기

네임 스페이스 내 XAML 독점 이유

<Activity mc:Ignorable="sap" x:Class="Project.WorkFlow.Activities.Activity4" sap:VirtualizedContainerService.HintSize="654,676" mva:VisualBasic.Settings="Assembly references and imported namespaces for internal implementation" xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities" xmlns:av="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mv="clr-namespace:Microsoft.VisualBasic;assembly=System" xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities" xmlns:p="http://ns.ns2.com/" xmlns:p1="http://schemas.microsoft.com/netfx/2009/xaml/servicemodel" xmlns:qm="clr-namespace:Project.MessageWrappers;assembly=Project.MessageWrappers" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:s1="clr-namespace:System;assembly=System" xmlns:s2="clr-namespace:System;assembly=System.Xml" xmlns:s3="clr-namespace:System;assembly=System.Core" xmlns:sa="clr-namespace:System.Activities;assembly=System.Activities" xmlns:sad="clr-namespace:System.Activities.Debugger;assembly=System.Activities" xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation" xmlns:scg="clr-namespace:System.Collections.Generic;assembly=System" xmlns:scg1="clr-namespace:System.Collections.Generic;assembly=System.ServiceModel" xmlns:scg2="clr-namespace:System.Collections.Generic;assembly=System.Core" xmlns:scg3="clr-namespace:System.Collections.Generic;assembly=mscorlib" xmlns:sd="clr-namespace:System.Data;assembly=System.Data" xmlns:sl="clr-namespace:System.Linq;assembly=System.Core" xmlns:ssa="clr-namespace:System.ServiceModel.Activities;assembly=System.ServiceModel.Activities" xmlns:ssx="clr-namespace:System.ServiceModel.XamlIntegration;assembly=System.ServiceModel" xmlns:st="clr-namespace:System.Text;assembly=mscorlib" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> 
<Flowchart sad:XamlDebuggerXmlReader.FileName="D:\Activity4.xaml" sap:VirtualizedContainerService.HintSize="614,636"> 
<Flowchart.Variables> 
    <Variable x:TypeArguments="qm:ClaimObj" Name="RequestObj" /> 
    <Variable x:TypeArguments="p1:CorrelationHandle" Name="handle" /> 
</Flowchart.Variables> 
<sap:WorkflowViewStateService.ViewState> 
    <scg3:Dictionary x:TypeArguments="x:String, x:Object"> 
    <x:Boolean x:Key="IsExpanded">False</x:Boolean> 
    <av:Point x:Key="ShapeLocation">270,2.5</av:Point> 
    <av:Size x:Key="ShapeSize">60,75</av:Size> 
    <av:PointCollection x:Key="ConnectorLocation">300,77.5 300,107.5 290,107.5 290,115</av:PointCollection> 
    </scg3:Dictionary> 
</sap:WorkflowViewStateService.ViewState> 
<Flowchart.StartNode> 
    <FlowStep x:Name="__ReferenceID1"> 
    <sap:WorkflowViewStateService.ViewState> 
     <scg3:Dictionary x:TypeArguments="x:String, x:Object"> 
     <av:Point x:Key="ShapeLocation">162.5,115</av:Point> 
     <av:Size x:Key="ShapeSize">255,90</av:Size> 
     <av:PointCollection x:Key="ConnectorLocation">290,205 290,235</av:PointCollection> 
     </scg3:Dictionary> 
    </sap:WorkflowViewStateService.ViewState> 
    <p1:Receive x:Name="__ReferenceID0" CanCreateInstance="True" CorrelatesWith="[handle]" sap:VirtualizedContainerService.HintSize="255,90" OperationName="Process" ServiceContractName="p:IActivity4Service"> 
     <p1:Receive.CorrelatesOn> 
     <p1:XPathMessageQuery x:Key="key1"> 
      <p1:XPathMessageQuery.Namespaces> 
      <ssx:XPathMessageContextMarkup> 
       <x:String x:Key="xg0">http://schemas.datacontract.org/2004/07/Project.MessageWrappers</x:String> 
      </ssx:XPathMessageContextMarkup> 
      </p1:XPathMessageQuery.Namespaces>sm:header()/tempuri:CorrelationId</p1:XPathMessageQuery> 
     </p1:Receive.CorrelatesOn> 
     <p1:ReceiveMessageContent DeclaredMessageType="qm:ClaimObj"> 
     <OutArgument x:TypeArguments="qm:ClaimObj">[RequestObj]</OutArgument> 
     </p1:ReceiveMessageContent> 
    </p1:Receive> 
    <FlowStep.Next> 
     <FlowStep x:Name="__ReferenceID2"> 
     <sap:WorkflowViewStateService.ViewState> 
      <scg3:Dictionary x:TypeArguments="x:String, x:Object"> 
      <av:Point x:Key="ShapeLocation">162.5,235</av:Point> 
      <av:Size x:Key="ShapeSize">255,90</av:Size> 
      </scg3:Dictionary> 
     </sap:WorkflowViewStateService.ViewState> 
     <p1:SendReply Request="{x:Reference __ReferenceID0}" DisplayName="SendReplyToReceive" sap:VirtualizedContainerService.HintSize="255,90"> 
      <p1:SendMessageContent DeclaredMessageType="qm:ClaimObj"> 
      <InArgument x:TypeArguments="qm:ClaimObj">[RequestObj]</InArgument> 
      </p1:SendMessageContent> 
     </p1:SendReply> 
     </FlowStep> 
    </FlowStep.Next> 
    </FlowStep> 
</Flowchart.StartNode> 
<x:Reference>__ReferenceID1</x:Reference> 
<x:Reference>__ReferenceID2</x:Reference> 

에 대한 변경

상관 관계에 대한 내 xpath 문제가 있다는 것을 알고 있습니다. 나는 많은 다른 아이디어를 시도하고 유일한 작품은 11445 (http://msdn.microsoft.com/en-us/library/ee358742.aspx)이지만 그것은 상관 관계를 추적하지 않습니다.

는 수신 : 여기 난 정말해야 할 일입니다 : UPDATE

이 내가 그것을 잘 DataContracts 작업을 얻을 수

sm:body()/xg0:ClaimObj/xg0:CorrelationId  
sm:header()/tempuri:CorrelationId 
sm:header()/xg0:ClaimObj/xg0:CorrelationId 
sm:header()/tempuri:ClaimObj/tempuri:CorrelationId 

작동하지 않습니다,하지만 난 MessageContracts

를 사용할 필요가 요청
은 서버에 편도 WCF 호출을 보내 X
(2 수신) 서버 X가 다른 물건을 할 상관 ID가 아닌 응답
로 새로운 WCF 호출에서 워크 플로 다시 전송
원래대로 응답 보내기

다음은 내가 작업하려고하는 기본 워크 플로입니다. 문제는 xpath가 발견되지 않아 두 번째 수신이 호출되지 않는다는 것입니다. 내가 처음에 correlationinitializer를 사용하려고하면 보조 노트에

, 내가

<Activity mc:Ignorable="sap" x:Class="Project.WorkFlow.Activities.Activity4" sap:VirtualizedContainerService.HintSize="828,872" mva:VisualBasic.Settings="Assembly references and imported namespaces for internal implementation" xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities" xmlns:av="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mv="clr-namespace:Microsoft.VisualBasic;assembly=System" xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities" xmlns:p="http://ns.domain.com/" xmlns:p1="http://schemas.microsoft.com/netfx/2009/xaml/servicemodel" xmlns:qm="clr-namespace:Project.MessageWrappers;assembly=Project.MessageWrappers" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:s1="clr-namespace:System;assembly=System" xmlns:s2="clr-namespace:System;assembly=System.Xml" xmlns:s3="clr-namespace:System;assembly=System.Core" xmlns:sa="clr-namespace:System.Activities;assembly=System.Activities" xmlns:sad="clr-namespace:System.Activities.Debugger;assembly=System.Activities" xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation" xmlns:scg="clr-namespace:System.Collections.Generic;assembly=System" xmlns:scg1="clr-namespace:System.Collections.Generic;assembly=System.ServiceModel" xmlns:scg2="clr-namespace:System.Collections.Generic;assembly=System.Core" xmlns:scg3="clr-namespace:System.Collections.Generic;assembly=mscorlib" xmlns:sd="clr-namespace:System.Data;assembly=System.Data" xmlns:sl="clr-namespace:System.Linq;assembly=System.Core" xmlns:ssa="clr-namespace:System.ServiceModel.Activities;assembly=System.ServiceModel.Activities" xmlns:ssx="clr-namespace:System.ServiceModel.XamlIntegration;assembly=System.ServiceModel" xmlns:st="clr-namespace:System.Text;assembly=mscorlib" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> 
<Flowchart sad:XamlDebuggerXmlReader.FileName="D:\Activity4.xaml" sap:VirtualizedContainerService.HintSize="788,832"> 
<Flowchart.Variables> 
    <Variable x:TypeArguments="qm:ClaimObj" Name="RequestObj" /> 
    <Variable x:TypeArguments="p1:CorrelationHandle" Name="handle" /> 
    <Variable x:TypeArguments="qm:GetClaimObj" Name="GetClaimIn" /> 
</Flowchart.Variables> 
<sap:WorkflowViewStateService.ViewState> 
    <scg3:Dictionary x:TypeArguments="x:String, x:Object"> 
    <x:Boolean x:Key="IsExpanded">False</x:Boolean> 
    <av:Point x:Key="ShapeLocation">270,2.5</av:Point> 
    <av:Size x:Key="ShapeSize">60,75</av:Size> 
    <av:PointCollection x:Key="ConnectorLocation">300,77.5 300,107.5 290,107.5 290,115</av:PointCollection> 
    <x:Double x:Key="Width">773.5</x:Double> 
    <x:Double x:Key="Height">796.04</x:Double> 
    </scg3:Dictionary> 
</sap:WorkflowViewStateService.ViewState> 
<Flowchart.StartNode> 
    <FlowStep x:Name="__ReferenceID1"> 
    <sap:WorkflowViewStateService.ViewState> 
     <scg3:Dictionary x:TypeArguments="x:String, x:Object"> 
     <av:Point x:Key="ShapeLocation">162.5,115</av:Point> 
     <av:Size x:Key="ShapeSize">255,90</av:Size> 
     <av:PointCollection x:Key="ConnectorLocation">290,205 290,209 241,209 241,239</av:PointCollection> 
     </scg3:Dictionary> 
    </sap:WorkflowViewStateService.ViewState> 
    <p1:Receive x:Name="__ReferenceID0" CanCreateInstance="True" CorrelatesWith="[handle]" sap:VirtualizedContainerService.HintSize="255,90" OperationName="Process" ServiceContractName="p:IActivity4Service"> 
     <p1:Receive.KnownTypes> 
     <x:Type Type="qm:ClaimObj" /> 
     </p1:Receive.KnownTypes> 
     <p1:ReceiveMessageContent DeclaredMessageType="qm:ClaimObj"> 
     <OutArgument x:TypeArguments="qm:ClaimObj">[RequestObj]</OutArgument> 
     </p1:ReceiveMessageContent> 
    </p1:Receive> 
    <FlowStep.Next> 
     <FlowStep x:Name="__ReferenceID2"> 
     <sap:WorkflowViewStateService.ViewState> 
      <scg3:Dictionary x:TypeArguments="x:String, x:Object"> 
      <av:Point x:Key="ShapeLocation">120,239</av:Point> 
      <av:Size x:Key="ShapeSize">242,93</av:Size> 
      <av:PointCollection x:Key="ConnectorLocation">241,332 240,332 240,355</av:PointCollection> 
      </scg3:Dictionary> 
     </sap:WorkflowViewStateService.ViewState> 
     <p1:InitializeCorrelation Correlation="[handle]" sap:VirtualizedContainerService.HintSize="242,93"> 
      <InArgument x:TypeArguments="x:String" x:Key="key1">[RequestObj.CorrelationId]</InArgument> 
     </p1:InitializeCorrelation> 
     <FlowStep.Next> 
      <FlowStep x:Name="__ReferenceID3"> 
      <sap:WorkflowViewStateService.ViewState> 
       <scg3:Dictionary x:TypeArguments="x:String, x:Object"> 
       <av:Point x:Key="ShapeLocation">112.5,355</av:Point> 
       <av:Size x:Key="ShapeSize">255,90</av:Size> 
       <av:PointCollection x:Key="ConnectorLocation">240,445 240,475 241,475 241,479</av:PointCollection> 
       </scg3:Dictionary> 
      </sap:WorkflowViewStateService.ViewState> 
      <p1:Receive CorrelatesWith="[handle]" sap:VirtualizedContainerService.HintSize="255,90" OperationName="GetClaim" ServiceContractName="p:IActivity4Service"> 
       <p1:Receive.CorrelatesOn> 
       <p1:XPathMessageQuery x:Key="key1"> 
        <p1:XPathMessageQuery.Namespaces> 
        <ssx:XPathMessageContextMarkup> 
         <x:String x:Key="xg0">http://schemas.datacontract.org/2004/07/Project.MessageWrappers</x:String> 
        </ssx:XPathMessageContextMarkup> 
        </p1:XPathMessageQuery.Namespaces>sm:header()/xg0:CorrelationId</p1:XPathMessageQuery> 
       </p1:Receive.CorrelatesOn> 
       <p1:ReceiveMessageContent DeclaredMessageType="qm:GetClaimObj"> 
       <OutArgument x:TypeArguments="qm:GetClaimObj">[GetClaimIn]</OutArgument> 
       </p1:ReceiveMessageContent> 
      </p1:Receive> 
      <FlowStep.Next> 
       <FlowStep x:Name="__ReferenceID4"> 
       <sap:WorkflowViewStateService.ViewState> 
        <scg3:Dictionary x:TypeArguments="x:String, x:Object"> 
        <av:Point x:Key="ShapeLocation">120,479</av:Point> 
        <av:Size x:Key="ShapeSize">242,58</av:Size> 
        <av:PointCollection x:Key="ConnectorLocation">241,537 240,537 240,565</av:PointCollection> 
        </scg3:Dictionary> 
       </sap:WorkflowViewStateService.ViewState> 
       <Assign sap:VirtualizedContainerService.HintSize="242,58"> 
        <Assign.To> 
        <OutArgument x:TypeArguments="x:String">[GetClaimIn.InstanceId]</OutArgument> 
        </Assign.To> 
        <Assign.Value> 
        <InArgument x:TypeArguments="x:String">Get is called</InArgument> 
        </Assign.Value> 
       </Assign> 
       <FlowStep.Next> 
        <FlowStep x:Name="__ReferenceID5"> 
        <sap:WorkflowViewStateService.ViewState> 
         <scg3:Dictionary x:TypeArguments="x:String, x:Object"> 
         <av:Point x:Key="ShapeLocation">112.5,565</av:Point> 
         <av:Size x:Key="ShapeSize">255,90</av:Size> 
         </scg3:Dictionary> 
        </sap:WorkflowViewStateService.ViewState> 
        <p1:SendReply Request="{x:Reference __ReferenceID0}" DisplayName="SendReplyToReceive" sap:VirtualizedContainerService.HintSize="255,90"> 
         <p1:SendMessageContent DeclaredMessageType="qm:GetClaimObj"> 
         <InArgument x:TypeArguments="qm:GetClaimObj">[GetClaimIn]</InArgument> 
         </p1:SendMessageContent> 
        </p1:SendReply> 
        </FlowStep> 
       </FlowStep.Next> 
       </FlowStep> 
      </FlowStep.Next> 
      </FlowStep> 
     </FlowStep.Next> 
     </FlowStep> 
    </FlowStep.Next> 
    </FlowStep> 
</Flowchart.StartNode> 
<x:Reference>__ReferenceID1</x:Reference> 
<x:Reference>__ReferenceID2</x:Reference> 
<x:Reference>__ReferenceID3</x:Reference> 
<x:Reference>__ReferenceID4</x:Reference> 
<x:Reference>__ReferenceID5</x:Reference> 

답변

1

내가 당신의 XAML에서 CorrelationInitializers을 잃었받을 같은 문제를 얻을. CorrelationInitializers는 원래 요청과 함께 Receive 또는 SendReply 활동에 상관 관계를 작성하는 데 사용됩니다. 그런 다음 CorrelatesOn은 후속 수신 활동에 사용됩니다.

+0

나는 초기화 장치를 제자리에 가지고있다. 나는 원래 게시물을 업데이트했다. – user456748

0

방금 ​​같은 문제가 발생하여 링크 된 기사가 실제로 문제를 해결하는 데 도움이되었습니다. XPath 쿼리는 상관 데이터가 오류가 다음과 같은 메시지가 반환됩니다 검색되지 않도록 잘못 이러한 구성되어 있으면 소개 페이지 내리막 길의 3/4, 읽고 단락 ...

이있다 : " 상관 쿼리는 빈 결과 집합을 산출했습니다. 끝점에 대한 상관 쿼리가 올바르게 구성되었는지 확인하십시오." 하나의 빠른 문제 해결 방법은 이전 섹션에서 설명한대로 XPath 쿼리를 리터럴 값으로 바꾸는 것입니다.상관 관계 초기화 프로그램 또는 상관 관계 정의 대화 상자에서 XPath 쿼리 작성기를 사용하고 워크 플로 서비스에서 메시지 계약을 사용하는 경우이 문제는 이 될 수 있습니다.

대화 상자는 선택한 속성이 메시지 머리글의 일부인 경우에도 항상 메시지 본문 속성을 대상으로하는 쿼리를 생성합니다. 헤더 속성에 액세스 할 수있는 올바른 쿼리는 다음과 같습니다

sm:header()/namespace:property 

속성 이름이 포함 된 객체에 의해 자격이되지 않으므로 다음 쿼리는 당신을 위해 작동해야하는 것으로 :

sm:header()/tempuri:CorrelationId 

당신이 원하는 경우 header 속성의 네임 스페이스를 변경하려면 MessageHeaderAttribute 클래스의 Namespace 속성을 사용하십시오.

관련 문제