PHP SOAP连接错误。未捕获SoapFault异常:[soap:Server]服务器无法处理请求

时间:2011-08-22 06:29:47

标签: php soap

SOAP输入:

POST /webservice.retail/retail.asmx HTTP/1.1
Host: factura.md
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/Login"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <Login xmlns="http://tempuri.org/">
      <login>string</login>
      <password>string</password>
      <messageDataAsXml>string</messageDataAsXml>
    </Login>
  </soap:Body>
</soap:Envelope>

肥皂输出:

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <LoginResponse xmlns="http://tempuri.org/">
      <LoginResult>boolean</LoginResult>
      <ticket>string</ticket>
      <messageDataAsXml>string</messageDataAsXml>
    </LoginResponse>
  </soap:Body>
</soap:Envelope>

我尝试连接此代码:

<?
$client = new SoapClient( '...WDSL...',
                          array('trace' => true));

$cred = array( 'Login' => 'USER',
               'Password' => 'PASS' );

$result = $client->Login( $cred );
?>

错误: 致命错误:未捕获的SoapFault异常:[soap:Server]服务器无法处理请求。 - &GT;对象引用未设置为对象的实例。

0 个答案:

没有答案