Zimbra SOAP API returns Document parse failed

Have a great idea for extending Zimbra? Share ideas, ask questions, contribute, and get feedback.
Post Reply
fmginting
Posts: 2
Joined: Fri Jul 23, 2021 9:43 am

Zimbra SOAP API returns Document parse failed

Post by fmginting »

using zimbra soap api 8.5.1

the following request ...

Code: Select all

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    <soap:Header>
        <context xmlns="urn:zimbra">
            <format type="xml"/>
            <csrfToken>this is token</csrfToken>
        </context>
    </soap:Header>
    <soap:Body>
        <SearchRequest xmlns="urn:zimbraMail" limit="100">
            <query>is:unread in:"/Inbox/a&b"</query>
        </SearchRequest>
    </soap:Body>
</soap:Envelope>
will return

Code: Select all

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    <soap:Body>
        <soap:Fault>
            <soap:Code>
                <soap:Value>soap:Sender</soap:Value>
            </soap:Code>
            <soap:Reason>
                <soap:Text>Document parse failed</soap:Text>
            </soap:Reason>
            <soap:Detail>
                <Error xmlns="urn:zimbra">
                    <Code>service.PARSE_ERROR</Code>
                    <Trace>qtp509886383-21014:http://our.mail.server/service/soap/GetSearchFolder:1629082192477:35d2d2d6d2b6780f</Trace>
                </Error>
            </soap:Detail>
        </soap:Fault>
    </soap:Body>
</soap:Envelope>
if i changed my folder name to a_and_b or just remove the '&' character(of course renaming folder in mailbox AND the soap request), it will return correct output.

Code: Select all

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    <soap:Header>
        <context xmlns="urn:zimbra">
            <change token="28009"/>
        </context>
    </soap:Header>
    <soap:Body>
        <SearchResponse offset="0" more="0" sortBy="dateDesc" xmlns="urn:zimbraMail"/>
    </soap:Body>
</soap:Envelope>
i dont want to rename my folder, as other thousand employee in our company who use character like '&'. how to get the correct output without renaming folder?
fmginting
Posts: 2
Joined: Fri Jul 23, 2021 9:43 am

Re: Zimbra SOAP API returns Document parse failed

Post by fmginting »

actually this problem already solved the day i post it.
its XML forbidden characters.
Post Reply