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?
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>