Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Defining XPath Query For Content Correlation

It seems like there are other posts on the web that ask the same thing but either they do not completely address the question or I am missing something (most likely the latter).

When defining the XPath query for content correlation for a XAMLX service, I am confused on where the namespace prefixes come from. For example, in the query "sm:body()/xg0:Id", where does "sm" and "xg0" come from. I assume that these are specified somewhere but I am not sure where. If I understand things correctly, the generate query when used with message contracts don't work. To some degree, I agree with this. If I change the prefix of "xg0" to "tempuri" I can get it work in basic cases but not in all cases. Is there a document that explains exactly how this query works?

like image 822
Jason Richmeier Avatar asked Dec 06 '25 06:12

Jason Richmeier


1 Answers

The namespace prefixes are stored in the XAMLX file. Unfortunately there is no UI that shows there values, you have to start digging through the XAMLX source. See the XPathMessageQuery.Namespaces section below where xgSc is defined as http://tempuri.org/

<Receive x:Name="__ReferenceID0" CanCreateInstance="True" DisplayName="ReceiveRequest" sap:VirtualizedContainerService.HintSize="255,86" OperationName="GetData" ServiceContractName="p:IService">
  <Receive.CorrelationInitializers>
    <RequestReplyCorrelationInitializer CorrelationHandle="[handle]" />
    <QueryCorrelationInitializer>
      <XPathMessageQuery x:Key="key1">
        <XPathMessageQuery.Namespaces>
          <ssx:XPathMessageContextMarkup>
            <x:String x:Key="xgSc">http://tempuri.org/</x:String>
          </ssx:XPathMessageContextMarkup>
        </XPathMessageQuery.Namespaces>sm:body()/xgSc:GetData/xgSc:orderId</XPathMessageQuery>
    </QueryCorrelationInitializer>
  </Receive.CorrelationInitializers>
  <ReceiveParametersContent>
    <p1:OutArgument x:TypeArguments="x:String" x:Key="orderId" />
  </ReceiveParametersContent>
</Receive>
like image 52
Maurice Avatar answered Dec 10 '25 13:12

Maurice



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!