none
EWS SOAP Api call GetSearchableMailboxes fails intermittently RRS feed

  • Question

  • I am making the SOAP API call getSearchableMailboxes api call as specified in the docs. However for the  same machine, same network, the same SOAP request headers and body; the request intermittently fails.

    Here is the Request headers:

    POST  https://outlook.office365.com/EWS/Exchange.asmx

    headers:

    'Accept-Language': 'en-us', 'Content-Language': 'en-us', 'SOAPAction': 'http://schemas.microsoft.com/exchange/services/2006/messages/GetSearchableMailboxes', 'Accept': '*/*', 'User-Agent': 'Some Agent' ,'Connection': 'Keep-Alive', 'Cache-Control': 'no-cache', 'Content-Type': 'text/xml; charset=utf-8', 'Authorization': 'Basic <auth key>'

    Body:

    <?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"
                               xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages">
                   <soap:Header>                                                    
                      <t:RequestServerVersion Version="Exchange2013_SP1" />         
                   </soap:Header>                                                   
                   <soap:Body>                                                      
                       <m:GetSearchableMailboxes>                                    
                         <m:SearchFilter></m:SearchFilter>                          
                          <m:ExpandGroupMembership>false</m:ExpandGroupMembership>   

                       </m:GetSearchableMailboxes>

                    </soap:Body>                                                     
      </soap:Envelope>

    The very same request results in 200 response with the expected response

    However sometimes it results in this response:

    HTTP 400 error:

    Last login: Sat Feb 23 13:08:13 on ttys000
    You have mail.
    ➜  ~ tmux attach





















































                <font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">^M
    ^M                                                                              
                <b> Description: </b>An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.^M
                <br><br>^M                                                          
    ^M                                                                              
                <b>Details:</b> To enable the details of this specific error message to be viewable on remote machines, please create a &lt;customErrors&gt; tag within a &quot;web.config&quot; configuration file located in the root directory of the current web application. This &lt;customErrors&gt; tag should then have its &quot;mode&quot; attribute set to &quot;Off&quot;.<br><br>^M
    ^M                                                                              
                <table width=100% bgcolor="#ffffcc">^M                              
                   <tr>^M                                                           
                      <td>^M                                                        
                          <code><pre>^M                                             
    ^M                                                                              
    &lt;!-- Web.Config Configuration File --&gt;^M                                  
    ^M                                                                              
    &lt;configuration&gt;^M                                                         
        &lt;system.web&gt;^M                                                        
            &lt;customErrors mode=&quot;Off&quot;/&gt;^M                            
        &lt;/system.web&gt;^M                                                       
    &lt;/configuration&gt;</pre></code>^M                                           
    ^M                                                                              
                      </td>^M                                                       
                   </tr>^M                                                          
                </table>^M                                                          
    ^M                                                                              
                <br>^M                                                              
    ^M                                                                              
                <b>Notes:</b> The current error page you are seeing can be replaced by a custom error page by modifying the &quot;defaultRedirect&quot; attribute of the application&#39;s &lt;customErrors&gt; configuration tag to point to a custom error page URL.<br><br>^M
    ^M                                                                              
                <table width=100% bgcolor="#ffffcc">^M                              
                   <tr>^M                                                           
                      <td>^M                                                        
                          <code><pre>^M                                             
    ^M                                                                              
    &lt;!-- Web.Config Configuration File --&gt;^M                                  
    ^M                                                                              
    &lt;configuration&gt;^M                                                         
        &lt;system.web&gt;^M                                                        
            &lt;customErrors mode=&quot;RemoteOnly&quot; defaultRedirect=&quot;mycustompage.htm&quot;/&gt;^M
        &lt;/system.web&gt;^M                                                       
    &lt;/configuration&gt;</pre></code>^M                                           
    ^M                                                                              
                      </td>^M                                                       
                   </tr>^M                                                          
                </table>^M                                                          
    ^M                                                                              
                <br>^M                                                              
    ^M                                                                              
        </body>^M                                                                   
    </html>^M         

           

    Wednesday, March 20, 2019 9:26 PM