Nusoap错误“WSDL文档中没有定义任何操作!”

时间:2015-06-06 06:39:37

标签: php web-services soap wsdl

嗨,我收到了一个错误:

  

WSDL文档中没有定义任何操作!

我正在寻找所有可能的方法来解决我的问题近一个星期但没有运气我找不到它。我使用nusoap库,这是我的代码:

<?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>';
  }
}

这是services.wsdl链接中的视图:

<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>

抱歉,我只是肥皂新手。我想要的只是运行基本功能,只显示登录用户的电子邮件或名称。提前致谢!

0 个答案:

没有答案