Hi I'm getting an error:
no operations defined in the WSDL document!
I'm searching all possible ways that might answer my problem for almost a week but no luck I can't find it. I use nusoap library and here's my code:
<?php
include_once('lib/nusoap.php');
$username = 'xxxxx@username.com';
$password = 'xxxxxxx';
$endpoint = 'https://mail.xxxxxxxxx.com/ews/services.wsdl';
$wsdl = true;
$soapclient = new nusoap_client($endpoint, $wsdl);
$xml = '<wsdl:definitions targetNamespace="http://schemas.microsoft.com/exchange/services/2006/messages">';
$xml .= '<wsdl:message name="UploadItemsSoapIn">';
$xml .= '<wsdl:part name="request" element="tns:UploadItems"/>';
$xml .= '<wsdl:part name="Impersonation" element="t:ExchangeImpersonation"/>';
$xml .= '<wsdl:part name="MailboxCulture" element="t:MailboxCulture"/>';
$xml .= '<wsdl:part name="RequestVersion" element="t:RequestServerVersion"/>';
$xml .= '</wsdl:message>';
$xml .= '</wsdl:definitions>';
$operation = 'UploadItemsSoapIn';
$result = $soapclient->call($operation,$xml);
$soapclient->setCredentials($username, $password, 'ntlm');
if ($soapclient->fault) {
echo '<h2>Fault (Expect - The request contains an invalid SOAP body)</h2><pre>'; print_r($result); echo '</pre>';
} else {
$err = $soapclient->getError();
if ($err) {
echo '<h2>Error</h2><pre>' . $err . '</pre>';
} else {
echo '<h2>Result</h2><pre>'; print_r($result); echo '</pre>';
}
}
and this is the view in services.wsdl link:
<wsdl:definitions targetNamespace="http://schemas.microsoft.com/exchange/services/2006/messages">
<wsdl:types>
<xs:schema>
<xs:import namespace="http://schemas.microsoft.com/exchange/services/2006/messages" schemaLocation="messages.xsd"/>
</xs:schema>
</wsdl:types>
<wsdl:message name="UploadItemsSoapIn">
<wsdl:part name="request" element="tns:UploadItems"/>
<wsdl:part name="Impersonation" element="t:ExchangeImpersonation"/>
<wsdl:part name="MailboxCulture" element="t:MailboxCulture"/>
<wsdl:part name="RequestVersion" element="t:RequestServerVersion"/>
</wsdl:message>
<wsdl:message name="UploadItemsSoapOut">
<wsdl:part name="UploadItemsResult" element="tns:UploadItemsResponse"/>
<wsdl:part name="ServerVersion" element="t:ServerVersionInfo"/>
</wsdl:message>
Sorry I'm just a newbie in soap. All I want is just to run the basic function and just display email or names of the login user. Thanks in advance!