Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3304780
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:05:54+00:00 2026-05-17T21:05:54+00:00

Just to be clear before continuing: using PHP’s built-in SOAP class is unfortunately not

  • 0

Just to be clear before continuing: using PHP’s built-in SOAP class is unfortunately not an option here (production server’s PHP is not built with it, and won’t be).


I’m trying to use EWS to allow me to authenticate users for a completely external server application. LDAP authentication has been disallowed. I have verified my EWS wsdl is correct via http://www.testexchangeconnectivity.com/, a Microsoft autodiscover tool. The contents of the WSDL can be found here: http://pastebin.org/214070

The server is using SSL, and is using the default authentication method for EWS of “NTLM”.

I’ve tried various code examples around the web, unfortunately I’m not well-versed in XML, SOAP, or cURL (which is pretty much all of the technology being used here). The current iteration of my code is found below:

<?php

include_once('./lib/nusoap.php');

$username = 'username@example.com';
$password = 'password';
$ews_url  = 'https://owa.example.com/EWS/Exchange.asmx';
$soapclient = new nusoap_client($service, true);
$soapclient->setCredentials($username, $password, 'ntlm');
$soapclient->setUseCurl(true);
$soapclient->useHTTPPersistentConnection();
$soapclient->setCurlOption(CURLOPT_USERPWD, $username.':'.$password);
$soapclient->soap_defencoding = 'UTF-8';

$params  = '<FindItem xmlns="http://schemas.microsoft.com/exchange/services/2006/messages"';
$params += ' xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" Traversal="Shallow">';
$params += '    <ItemShape>';
$params += '        <t:BaseShape>IdOnly</t:BaseShape>';
$params += '        <t:AdditionalProperties>';
$params += '            <t:FieldURI FieldURI="message:From"/>';
$params += '            <t:FieldURI FieldURI="item:Subject"/>';
$params += '            <t:FieldURI FieldURI="message:IsRead"/>';
$params += '            <t:FieldURI FieldURI="item:DateTimeReceived"/>';
$params += '            <t:FieldURI FieldURI="calendar:Start"/>';
$params += '            <t:FieldURI FieldURI="calendar:End"/>';
$params += '            <t:FieldURI FieldURI="calendar:Location"/>';
$params += '            <t:FieldURI FieldURI="task:Status"/>';
$params += '            <t:FieldURI FieldURI="task:DueDate"/>';
$params += '        </t:AdditionalProperties>';
$params += '    </ItemShape>';
$params += '    <IndexedPageItemView Offset="0" MaxEntriesReturned="5" BasePoint="Beginning"/>';
$params += '    <ParentFolderIds>';
$params += '        <t:DistinguishedFolderId Id="inbox"/>';
$params += '    </ParentFolderIds>';
$params += '</FindItem>';

$operation = 'FindItem';
$namespace = '';
$soapAction = '';
$headers = false;
$result = $soapclient->call($operation, $params, $namespace, $soapAction, $headers);
echo '<pre>'; print_r($result); echo '</pre>';

if($soapclient->fault){
    echo 'FAULT: ';
    echo '<pre>'; print_r($result); echo '</pre>';
}else{
    $err = $soapclient->getError();
    if ($err) {
        echo '<p><b><u>Error</u>:</b><br />' . $err . '</p>';
    }else{
        echo 'Connection succeeded.';
    }
}
?>

The actual issue I am having is that NuSOAP is returning a generic error message of: “no operations defined in the WSDL document!”. From the looks of the WSDL, this seems incorrect and makes me believe I’m missing something in code. If I remove the actual client call in the code ($soapclient->call(…)), the code prints out “Connection succeeded.”, but it does this with or without the attempted NTLM authentication code.

I’ve also tried using the “php-ews” project on my development machine (even though the same code would not work on the production server) and was also unable to access anything without receiving an error.

If anyone has any experience with any of these technologies and might be able to point out some clarification (or possible errors) I would greatly appreciate it. If any further clarification is needed on my part, please let me know.

UPDATE 1:
It seems one error in loading the WSDL is the NTLM Authentication. Using cURL alone (no NuSOAP) I was able to access the WSDL file and find out the server is redirecting to a different endpoint location (…/EWS/Services.wsdl).

Unfortunately, I’ve tried using the NuSOAP library’s cURL ability and setting the same options through NuSOAP, and I am still getting the same generic error message as if NuSOAP is just unable to see/view/access the WSDL file. I believe it may still be NTLM Authentication as the cURL version takes a few moments to return (NTLM it a multi-step handshake process), whereas the NuSOAP client code is immediately returning the error message.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T21:05:54+00:00Added an answer on May 17, 2026 at 9:05 pm

    There’s a few things you’ll want to look at here.

    1. There’s an error in your call to the actual soap_client. You defined the endpoint in a variable called $ews_url, but then called the constructor with $service.

    2. Why are you adding a string to a string in your $xml variable – perhaps in your haste you meant to concatenate instead? (operators: + vs .)

    3. Using the following Wiki information directed to working with EWS in Java, it seems that Microsoft has yet again blundered in their implementation of a common protocol. The modification of types.xsd in this Wiki actually causes a problem, so ignore that change, but downloading a local copy of Services.wsdl and modifying it to point to your own server seems to work properly. http://www.bedework.org/trac/bedework/wiki/ExchangeWSlink text

    The following code should work, so long as you have downloaded a local copy of your types.xsd, messages.xsd, and Services.wsdl – and modified the Services.wsdl file to add the required information relevant to your server. Make sure the local copies of those files are in the same folder on your server.

    <?php
        include_once('./lib/nusoap.php');
    
        $username = 'username@example.com';
        $password = 'password';
        $endpoint = 'http://your.local.version/of/Services.wsdl';
        $wsdl = true;
        $soapclient = new nusoap_client($endpoint, $wsdl);
    
        $soapclient->setCredentials($username, $password, 'ntlm');
    
        $xml  = '<FindItem xmlns="http://schemas.microsoft.com/exchange/services/2006/messages"';
        $xml .= ' xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" Traversal="Shallow">';
        $xml .= '   <ItemShape>';
        $xml .= '       <t:BaseShape>IdOnly</t:BaseShape>';
        $xml .= '       <t:AdditionalProperties>';
        $xml .= '           <t:FieldURI FieldURI="message:From"/>';
        $xml .= '           <t:FieldURI FieldURI="item:Subject"/>';
        $xml .= '           <t:FieldURI FieldURI="message:IsRead"/>';
        $xml .= '           <t:FieldURI FieldURI="item:DateTimeReceived"/>';
        $xml .= '           <t:FieldURI FieldURI="calendar:Start"/>';
        $xml .= '           <t:FieldURI FieldURI="calendar:End"/>';
        $xml .= '           <t:FieldURI FieldURI="calendar:Location"/>';
        $xml .= '           <t:FieldURI FieldURI="task:Status"/>';
        $xml .= '           <t:FieldURI FieldURI="task:DueDate"/>';
        $xml .= '       </t:AdditionalProperties>';
        $xml .= '   </ItemShape>';
        $xml .= '   <IndexedPageItemView Offset="0" MaxEntriesReturned="5" BasePoint="Beginning"/>';
        $xml .= '   <ParentFolderIds>';
        $xml .= '       <t:DistinguishedFolderId Id="inbox"/>';
        $xml .= '   </ParentFolderIds>';
        $xml .= '</FindItem>';
    
        $operation = 'FindItem';
        $result = $soapclient->call($operation, $xml);
        echo '<pre>'; print_r($result); echo '</pre>';
    ?>
    

    The solution all seems to stem from having a local copy of the main SOAP reference files, and fixing the Services.wsdl file. If you had access to the Exchange server, you might be able to modify the Services.wsdl file and everything could have worked as expected without all of this hassle. I cannot verify this, unfortunately.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just to make this clear - what is the difference between: String(value) and value
I just wanted to know what's the difference between clear() and str(); For example:
Just looking for the first step basic solution here that keeps the honest people
Edit: Two options shown below. If you're just using the functionality that an IDisposable
I just finished watching the Google clean code video on YouTube (see link ,
Just what the title says, I need to change the password for an existing
just a quick question: I am a CS undergrad and have only had experience
Just bought a 2.4GHz Intel Core 2 Duo iMac with 2GB of memory and
Just getting my head around Ruby metaprogramming. The mixin/modules always manage to confuse me.
Just how much slower are events? I have written a streaming XML parser (that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.