I am using wso2esb-4.8.1,
I wish to change my request and response before sending to endpoint and client
so my request is
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header xmlns:env="http://eai.ttt.pp.hh" xmlns:open="http://www.oly.org/" xmlns:xsi="xsi">
<pr:authentication soapenv:her="http://schemas.xmlsoap.org/soap/her/next" soapenv:mustUnderstand="0" xmlns:pr="http://webservices.temp.com/ProxyService">
<pr:user>sec5</pr:user>
<pr:password>ss</pr:password>
</pr:authentication>
</soapenv:Header>
<soapenv:Body>
<open:clientRequest xmlns:open="http://www.oly.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<env:EaiEnvelope xmlns:env="http://eai.ttt.pp.hh">
<env:Language>en</env:Language>
<env:UserId>admc</env:UserId>
<env:Payload>
<ss:security xmlns:ss="http://eai.admc.kyt/security">
<ss:Request>
<ss:Operation_Name>securityrem</ss:Operation_Name>
<ss:customerID>
<ss:no>9875452</ss:no>
<ss:Service_Type>gsm</ss:Service_Type>
</ss:customerID>
<ss:customer>
<ss:isCredit>false</ss:isCredit>
<ss:Amount>100000</ss:Amount>
<ss:transaction_Id>4301298</ss:transaction_Id>
<ss:TransactionTypeID>228</ss:TransactionTypeID>
<!--<ss:DeductionPriorityCode>2</ss:DeductionPriorityCode>-->
</ss:customer>
</ss:Request>
</ss:security>
</env:Payload>
</env:EaiEnvelope>
</open:clientRequest>
</soapenv:Body>
</soapenv:Envelope>
I wish to change the ss:security element namespace with xmlns:emp="http://uri.open.gen/com" so my request should be change as per new Namespace its lke this
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header xmlns:env="http://eai.ttt.pp.hh" xmlns:open="http://www.oly.org/" xmlns:xsi="xsi">
<pr:authentication soapenv:her="http://schemas.xmlsoap.org/soap/her/next" soapenv:mustUnderstand="0" xmlns:pr="http://webservices.temp.com/ProxyService">
<pr:user>sec5</pr:user>
<pr:paempword>emp</pr:paempword>
</pr:authentication>
</soapenv:Header>
<soapenv:Body>
<open:clientRequest xmlns:open="http://www.oly.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<env:EaiEnvelope xmlns:env="http://eai.ttt.pp.hh">
<env:Language>en</env:Language>
<env:UserId>admc</env:UserId>
<env:Payload>
<emp:safety xmlns:emp="http://uri.open.gen/com">
<emp:Request>
<emp:Operation_Name>securityrem</emp:Operation_Name>
<emp:customerID>
<emp:no>9875452</emp:no>
<emp:Service_Type>gsm</emp:Service_Type>
</emp:customerID>
<emp:customer>
<emp:isCredit>false</emp:isCredit>
<emp:Amount>100000</emp:Amount>
<emp:transaction_Id>4301298</emp:transaction_Id>
<emp:TransactionTypeID>228</emp:TransactionTypeID>
<!--<emp:DeductionPriorityCode>2</emp:DeductionPriorityCode>-->
</emp:customer>
</emp:Request>
</emp:safety>
</env:Payload>
</env:EaiEnvelope>
</open:clientRequest>
</soapenv:Body>
</soapenv:Envelope>
So i have tried with xquery but its unable to do someone please responed for this
i have tried with this xquery
<x xmlns="http://ws.apache.org/ns/synapse">
declare namespace soapenv = "http://schemas.xmlsoap.org/soap/envelope";
declare namespace soap="http://schemas.xmlsoap.org/soap/envelope/";
declare namespace open="http://www.ffff.org/";
declare variable $emp as xs:string+:="http://uri.open.gen/com";
declare namespace env="http://eai.jj.mmm/Envelope";
declare variable $Request xs:string+ external;
declare variable $EaiEnvelope as document-node() external;
element{'open:clientRequest'}{
element{'*:EaiEnvelope'}{$EaiEnvelope//*:EaiEnvelope/*[not(local-name()='Payload')],
element{'*:Payload'}{
element{QName($emp,concat('emp',':','safety'))}
$Request//env:Payload/*[1]/*
}}
}
</x>
but its giving exception token is not specified
Thanks in advance
If XSLT 2.0 is an option for you (for example using saxon XSLT processor). You can apply this stylesheet to youe input:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ss="http://eai.admc.kyt/security"
xmlns:emp="http://uri.open.gen/com"
version="2.0">
<xsl:template match="node()|#*">
<xsl:copy>
<xsl:apply-templates select="node()|#*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="ss:*">
<xsl:element name="emp:{local-name()}">
<xsl:apply-templates select="node()|#*"/>
</xsl:element>
</xsl:template>
<xsl:template match="#ss:*">
<xsl:attribute name="emp:{local-name()}">
<xsl:apply-templates select="node()|#*"/>
</xsl:attribute>
</xsl:template>
</xsl:stylesheet>
Every attribute and element in http://eai.admc.kyt/security namespace in input will be in the other namespace in the output.
One note: it won't change in the comments
Here's an XQuery option...
XML Input
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header xmlns:env="http://eai.ttt.pp.hh" xmlns:open="http://www.oly.org/" xmlns:xsi="xsi">
<pr:authentication soapenv:her="http://schemas.xmlsoap.org/soap/her/next" soapenv:mustUnderstand="0" xmlns:pr="http://webservices.temp.com/ProxyService">
<pr:user>sec5</pr:user>
<pr:password>ss</pr:password>
</pr:authentication>
</soapenv:Header>
<soapenv:Body>
<open:clientRequest xmlns:open="http://www.oly.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<env:EaiEnvelope xmlns:env="http://eai.ttt.pp.hh">
<env:Language>en</env:Language>
<env:UserId>admc</env:UserId>
<env:Payload>
<ss:security xmlns:ss="http://eai.admc.kyt/security">
<ss:Request>
<ss:Operation_Name>securityrem</ss:Operation_Name>
<ss:customerID>
<ss:no>9875452</ss:no>
<ss:Service_Type>gsm</ss:Service_Type>
</ss:customerID>
<ss:customer>
<ss:isCredit>false</ss:isCredit>
<ss:Amount>100000</ss:Amount>
<ss:transaction_Id>4301298</ss:transaction_Id>
<ss:TransactionTypeID>228</ss:TransactionTypeID>
<!--<ss:DeductionPriorityCode>2</ss:DeductionPriorityCode>-->
</ss:customer>
</ss:Request>
</ss:security>
</env:Payload>
</env:EaiEnvelope>
</open:clientRequest>
</soapenv:Body>
</soapenv:Envelope>
XQuery
declare namespace emp="http://uri.open.gen/com";
declare namespace pr="http://webservices.temp.com/ProxyService";
declare namespace soapenv="http://schemas.xmlsoap.org/soap/envelope/";
declare namespace open="http://www.oly.org/";
declare namespace env="http://eai.ttt.pp.hh";
declare function local:ident($node as node()) {
if ($node instance of element()) then
if (namespace-uri($node) = 'http://eai.admc.kyt/security') then
local:change-ss($node)
else
element {$node/name()} {$node/#*,
for $child in $node/node() return local:ident($child)}
else if ($node instance of attribute()) then
if (namespace-uri($node) = 'http://eai.admc.kyt/security') then
local:change-ss($node)
else
$node
else if ($node instance of comment()) then
local:change-ss($node)
else
$node
};
declare function local:change-ss($node as node()) {
if ($node instance of element()) then
element {xs:QName(concat('emp:',$node/local-name()))} {
for $node in $node/(#*|node())
return
local:ident($node)
}
else if ($node instance of attribute()) then
attribute {xs:QName(concat('emp:',$node/local-name()))} {$node}
else if ($node instance of comment()) then
comment {replace($node,'(</?)ss:','$1emp:')}
else
$node
};
local:ident(/*)
XML Output
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<pr:authentication xmlns:pr="http://webservices.temp.com/ProxyService"
soapenv:her="http://schemas.xmlsoap.org/soap/her/next"
soapenv:mustUnderstand="0">
<pr:user>sec5</pr:user>
<pr:password>ss</pr:password>
</pr:authentication>
</soapenv:Header>
<soapenv:Body>
<open:clientRequest xmlns:open="http://www.oly.org/">
<env:EaiEnvelope xmlns:env="http://eai.ttt.pp.hh">
<env:Language>en</env:Language>
<env:UserId>admc</env:UserId>
<env:Payload>
<emp:security xmlns:emp="http://uri.open.gen/com">
<emp:Request>
<emp:Operation_Name>securityrem</emp:Operation_Name>
<emp:customerID>
<emp:no>9875452</emp:no>
<emp:Service_Type>gsm</emp:Service_Type>
</emp:customerID>
<emp:customer>
<emp:isCredit>false</emp:isCredit>
<emp:Amount>100000</emp:Amount>
<emp:transaction_Id>4301298</emp:transaction_Id>
<emp:TransactionTypeID>228</emp:TransactionTypeID>
<!--<emp:DeductionPriorityCode>2</emp:DeductionPriorityCode>-->
</emp:customer>
</emp:Request>
</emp:security>
</env:Payload>
</env:EaiEnvelope>
</open:clientRequest>
</soapenv:Body>
</soapenv:Envelope>
The 2 XQuery functions can be combined to make it smaller, but I thought it was a little more readable.
Related
How to write XPath to get AddResult text value
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<AddResponse xmlns="http://tempuri.org/">
<AddResult>128</AddResult>
</AddResponse>
</soap:Body>
</soap:Envelope>
I tried below but not getting the desired result
declare namespace soap='http://www.w3.org/2003/05/soap-envelope';
/soap:Envelope/soap:Body/AddResponse/AddResult/text()
Found Answeer:
I should create another namespace with url same as in response xml and use in xpath,below is the answer
declare namespace soap='http://www.w3.org/2003/05/soap-envelope';
declare namespace xmlns='http://tempuri.org/';
/soap:Envelope/soap:Body/xmlns:AddResponse/xmlns:AddResult/text()
I cannot find any solution to properly list all public folder mailboxes and public folders using SOAP api. I found only powershell commands or C# methods. If anybody know how to get/list all public folders, please provide me with the solution.
To enumerate Public Folders you need to use the FindFolder operation and then make a Shallow traversal query of each folder level starting at the Root (because you can't do deep traversals) eg
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<soap:Body>
<FindFolder Traversal="Shallow" xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
<FolderShape>
<t:BaseShape>Default</t:BaseShape>
</FolderShape>
<ParentFolderIds>
<t:DistinguishedFolderId Id="publicfoldersroot"/>
</ParentFolderIds>
</FindFolder>
</soap:Body>
</soap:Envelope>
You can't get Public folder Mailboxes using EWS what you should be doing on Office365 is discovering the correct PublicFolder Mailbox to include in the routing headers so you should read through https://learn.microsoft.com/en-us/exchange/client-developer/exchange-web-services/how-to-route-public-folder-hierarchy-requests and https://learn.microsoft.com/en-us/exchange/client-developer/exchange-web-services/how-to-route-public-folder-content-requests (which both have XML samples for the calls you need).
Firstly, you need to determine the value of the X-AnchorMailbox header using SOAP and make an Autodiscover request to determine the X-PublicFolderInformation value.
Secondly, use FindFolder and then traversal query of each folder level starting at the Root, for example:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<t:RequestServerVersion Version="Exchange2013_SP1" />
</soap:Header>
<soap:Body>
<m:FindFolder Traversal="Shallow">
<m:FolderShape>
<t:BaseShape>AllProperties</t:BaseShape>
</m:FolderShape>
<m:IndexedPageFolderView MaxEntriesReturned="1" Offset="0" BasePoint="Beginning" />
<m:Restriction>
<t:IsEqualTo>
<t:FieldURI FieldURI="folder:DisplayName" />
<t:FieldURIOrConstant>
<t:Constant Value="My Public Contacts" />
</t:FieldURIOrConstant>
</t:IsEqualTo>
</m:Restriction>
<m:ParentFolderIds>
<t:FolderId Id="AQEuAAADy/LIWjRCp0GFb0W6aGPbwwEARg5aCLUc8k6wLfl1c0a/2AAAAwIAAAA=" ChangeKey="AQAAABYAAABGDloItRzyTrAt+XVzRr/YAABdo/XB" />
</m:ParentFolderIds>
</m:FindFolder>
</soap:Body>
</soap:Envelope>
Reference from:
Route public folder hierarchy requests
Route public folder content requests
I have a sample XML document like
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<SearchSecretsResponse xmlns="urn:thesecretserver.com">
<SearchSecretsResult>
<Errors/>
<SecretSummaries>
<SecretSummary>
<SecretId>86</SecretId>
<SecretName>hostName\root</SecretName>
<SecretTypeName>Unix Root Account (SSH)</SecretTypeName>
</SecretSummary>
</SecretSummaries>
</SearchSecretsResult>
</SearchSecretsResponse>
</soap:Body>
</soap:Envelope>
I am trying to parse it using Nokogiri. My code is
doc = Nokogiri::XML.parse(xml)
puts doc.xpath('//SecretSummary')
But this doesn't print anything. What am I doing wrong ?
You'll need to alias the namespace.
Nokogiri::XML(xml).xpath('//foo:SecretSummary', 'foo' => 'urn:thesecretserver.com')
You could also remove the namespaces
doc.remove_namespaces!
I'm facing a weird problem (IMHO) which, in short, is:
a node list passed as a parameter to a template can't be sorted.
Here's an example.
The input file is:
<root>
<a>BBB</a>
<a>AAA</a>
</root>
And the transformation is:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" />
<xsl:template match="/">
<Root>
<xsl:call-template name="processThis">
<xsl:with-param name="nodeList" select="/*/a"/>
</xsl:call-template>
</Root>
</xsl:template>
<xsl:template name="processThis">
<xsl:param name="nodeList" />
<xsl:for-each select="$nodeList">
<xsl:sort /><!-- ***** This causes the problem -->
<xsl:variable name="thisVal" select="." />
<result value="{$thisVal}" />
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
The expected output is:
<Root>
<result value="AAA" />
<result value="BBB" />
</Root>
But if I run the transformation, just an empty 'Root' element is generated, without child nodes.
If I comment out the line marked with '*****', the generated Root element does contain child elements, but unsorted (as one would expect in this case).
If I process the elements directly (and not in a template passing the list to process as a parameter), then I can use 'sort', and everything works as expected. Here is the 'direct' transformation:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" />
<xsl:template match="/">
<Root>
<xsl:for-each select="/*/a">
<xsl:sort />
<xsl:variable name="thisVal" select="." />
<result value="{$thisVal}" />
</xsl:for-each>
</Root>
</xsl:template>
</xsl:stylesheet>
So my question is: why isn't a list passed as a parameter to a template processed with a 'sort' option?
Update from Mar 07 2016:
XmlSpy and some online XSL processors deliver the expected (sorted) output.
I've tried it with a standalone Java program, and it gives me the wrong result. Here's the program:
package my.test;
import java.io.File;
import java.io.StringWriter;
import javax.xml.transform.Result;
import javax.xml.transform.Source;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
public class Transform {
public static void main(String[] args) throws Exception {
String inputFileName = "Q:\\MiscThings\\t\\a.xml";
String xslFileName = "Q:\\MiscThings\\t\\trans.xsl";
Source xmlSource = new StreamSource(new File(inputFileName));
Source xslSource = new StreamSource(new File(xslFileName));
StringWriter stringWriter = new StringWriter();
Result transformationResult = new StreamResult(stringWriter);
TransformerFactory transformerFactory = TransformerFactory.newInstance();
Transformer transformer = transformerFactory.newTransformer(xslSource);
transformer.transform(xmlSource, transformationResult);
stringWriter.flush();
String xmlResult = stringWriter.toString();
System.out.println(xmlResult);
}
}
I resolved the issue by explicitly specifying the XSL processor to be used. It seems to me that the JDK I use (I tried JRE7 and JRE8) includes an older version of XSL processor which does not process files correctly.
I downloaded Xalan 2.7.2 and specified its JAR in the 'xslt' ant task -- and immediately got the correct result.
I also tried saxon 9, and also got the correct result.
I'm surprised by the fact that a modern JRE is packaged with a flawed XSL processor. The transformation I perform is not a complicated one in my view.
I'm using a FindItem call to get items (appointments) from Exchange Web Services (EWS). The properties which are fetched are the item Id and the EffectiveRights. The EffectiveRights property often does not contain the correct values. Sometimes, however, the values are correct (using the same code), but I don't know what causes this.
The Calendar folder I'm searching in is delegated with Author rights to the service user I authenticate with and it contains appointments of which this service user is the author of.
I'm using the ews-java-api library and the response traces show that this isn't a parsing bug.
The code used to retrieve the items:
ItemView view = new ItemView(100);
PropertySet propertySet = new PropertySet();
propertySet.add(ItemSchema.Id);
propertySet.add(ItemSchema.EffectiveRights);
view.setPropertySet(propertySet);
FolderId folderId = new FolderId(WellKnownFolderName.Calendar, Mailbox.getMailboxFromString(targetSmtpAddress));
FindItemsResults<Item> items = service.findItems(folderId, filter, view);
Item firstItem = items.getItems().get(0);
firstItem.getEffectiveRights(); // Returns NONE, READ. This is incorrect.
Item bindItem = Item.bind(service, firstItem.getId()); //
bindItem.getEffectiveRights(); // Returns NONE, READ, MODIFY, DELETE. This is correct.
The request trace:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<soap:Header>
<t:RequestServerVersion Version="Exchange2010_SP2"></t:RequestServerVersion>
</soap:Header>
<soap:Body>
<m:FindItem Traversal="Shallow">
<m:ItemShape>
<t:BaseShape>IdOnly</t:BaseShape>
<t:AdditionalProperties>
<t:FieldURI FieldURI="item:ItemId"></t:FieldURI>
<t:FieldURI FieldURI="item:EffectiveRights"></t:FieldURI>
</t:AdditionalProperties>
</m:ItemShape>
<m:IndexedPageItemView MaxEntriesReturned="1000" Offset="0" BasePoint="Beginning"></m:IndexedPageItemView>
<m:Restriction>
<t:And>
<t:IsEqualTo>
<t:ExtendedFieldURI PropertySetId="039b4d91-2f03-44da-887c-aad704243ba8" PropertyName="SyncId" PropertyType="String"></t:ExtendedFieldURI>
<t:FieldURIOrConstant>
<t:Constant Value="syncID:330"></t:Constant>
</t:FieldURIOrConstant>
</t:IsEqualTo>
<t:IsGreaterThanOrEqualTo>
<t:FieldURI FieldURI="calendar:Start"></t:FieldURI>
<t:FieldURIOrConstant>
<t:Constant Value="2015-01-28T13:53:38Z"></t:Constant>
</t:FieldURIOrConstant>
</t:IsGreaterThanOrEqualTo>
</t:And>
</m:Restriction>
<m:ParentFolderIds>
<t:DistinguishedFolderId Id="calendar">
<t:Mailbox>
<t:EmailAddress>TARGETUSER#SMTP.ADDRESS</t:EmailAddress>
</t:Mailbox>
</t:DistinguishedFolderId>
</m:ParentFolderIds>
</m:FindItem>
</soap:Body>
</soap:Envelope>
The trace of a 'faulty' response:
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:ServerVersionInfo MajorVersion="14" MinorVersion="3" MajorBuildNumber="224" MinorBuildNumber="2" Version="Exchange2010_SP2" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"/>
</s:Header>
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<m:FindItemResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<m:ResponseMessages>
<m:FindItemResponseMessage ResponseClass="Success">
<m:ResponseCode>NoError</m:ResponseCode>
<m:RootFolder IndexedPagingOffset="1000" TotalItemsInView="1868" IncludesLastItemInRange="false">
<t:Items>
<t:CalendarItem>
<t:ItemId Id="AAMkAGVlZmVlY2JjLTcxOTItNDBkYi1hOTljLTkwZjQwZjE4MTU1NQBGAAAAAADZ8IosQv76QbxS0r8FeFzgBwB25IsPmJcKTaP6zvCUqaybAAAAoIe5AAB25IsPmJcKTaP6zvCUqaybAABcSsgnAAA=" ChangeKey="DwAAABYAAAB25IsPmJcKTaP6zvCUqaybAABcS6ER"/>
<t:EffectiveRights>
<t:CreateAssociated>false</t:CreateAssociated>
<t:CreateContents>false</t:CreateContents>
<t:CreateHierarchy>false</t:CreateHierarchy>
<t:Delete>false</t:Delete>
<t:Modify>false</t:Modify>
<t:Read>true</t:Read>
<t:ViewPrivateItems>false</t:ViewPrivateItems>
</t:EffectiveRights>
</t:CalendarItem>
<t:CalendarItem>
<t:ItemId Id="AAMkAGVlZmVlY2JjLTcxOTItNDBkYi1hOTljLTkwZjQwZjE4MTU1NQBGAAAAAADZ8IosQv76QbxS0r8FeFzgBwB25IsPmJcKTaP6zvCUqaybAAAAoIe5AAB25IsPmJcKTaP6zvCUqaybAABcSsglAAA=" ChangeKey="DwAAABYAAAB25IsPmJcKTaP6zvCUqaybAABcS6EN"/>
<t:EffectiveRights>
<t:CreateAssociated>false</t:CreateAssociated>
<t:CreateContents>false</t:CreateContents>
<t:CreateHierarchy>false</t:CreateHierarchy>
<t:Delete>false</t:Delete>
<t:Modify>false</t:Modify>
<t:Read>true</t:Read>
<t:ViewPrivateItems>false</t:ViewPrivateItems>
</t:EffectiveRights>
</t:CalendarItem>
<!-- MORE ITEMS HERE... -->
</t:Items>
</m:RootFolder>
</m:FindItemResponseMessage>
</m:ResponseMessages>
</m:FindItemResponse>
</s:Body>
</s:Envelope>
I already found this blog post which seems somewhat related, but nothing more than that.
FindItems loads values from the contents table of a folder, rather than from the items themselves. Many times, with computed properties like EffectiveRights, a simplistic approach is used to populate the table to give an approximation. It seems like that's what's happening here. The comment in your code mentions that the value is correct after you Bind to the item (which loads values from the item itself).