Php 为什么我会出现这个错误;falseObject引用未设置为对象的实例;当我调用Web服务中的操作时

Php 为什么我会出现这个错误;falseObject引用未设置为对象的实例;当我调用Web服务中的操作时,php,web-services,soap,wsdl,Php,Web Services,Soap,Wsdl,我有一个web服务,我正在使用PHP中的SOAP客户端调用它的一个操作,但我得到的只是这个[“any”]=>字符串(120)“falseObject引用未设置为对象的实例。 我想知道我的代码中是否有任何错误,因为我相信我与web服务的连接%100正常工作 我正在创建的xml字符串中是否有任何错误 行动是: <wsdl:operation name="XmlIslet"> <wsdl:input message="tns:XmlIsletSoapIn"/>

我有一个web服务,我正在使用PHP中的SOAP客户端调用它的一个操作,但我得到的只是这个
[“any”]=>字符串(120)“falseObject引用未设置为对象的实例。

我想知道我的代码中是否有任何错误,因为我相信我与web服务的连接%100正常工作

我正在创建的xml字符串中是否有任何错误

行动是:

<wsdl:operation name="XmlIslet">
    <wsdl:input message="tns:XmlIsletSoapIn"/>
    <wsdl:output message="tns:XmlIsletSoapOut"/>
</wsdl:operation>
编辑: 我尝试使用
htmlentities($client->\uu getLastRequest())
获取请求xml,它显示了我请求的一个空正文:

========= REQUEST ========== 
string(292) 
"<?xml version="1.0" encoding="UTF-8"?> 
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://tempuri.org/">
<SOAP-ENV:Body>
<ns1:XmlIslet>
<ns1:xmlIslem/>
<ns1:xmlYetki/>
</ns1:XmlIslet>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope> "
请求 字符串(292) " "
您很可能正在与.NET服务通信。此错误消息基本上是一条“变量未定义”消息

WSDL文件说,您的请求必须包含两个实体:xmlIslem和xmlYetki。但是,它们的内部结构没有正确定义,可以是“任何”东西。然而,这并不意味着remove web服务不希望您提供一些数据。看起来您需要传递一些数据,而您没有,因此出现了错误


我会联系web服务提供商,要求提供文档或特定的请求示例。

可能该对象不存在于xml中,以检查xml的格式是否错误,因为响应为200,这意味着一切正常,但读取的对象属性是null@Rico哪一个对象?我检查了它正在工作的连接nd没有抛出任何错误,然后我调用操作
$client->xmlisle
@Rico我使用了这个
如果(is_soap_fault($response)){trigger_error(“soap fault:{$response->faultcode},faultstring:{$response->faultstring})”,E_USER_error);
并且它没有抛出任何错误这一行做什么“$username.”“$password.”->documentElement);o。O@Rico它应该将一个XMLstring解析为xmldomobj,然而,虽然它有无效的XML,但它不起作用,它应该有

<?php
$username = "username";
$password = "password";
$xmlString = "<Firmalar></Firmalar>";

function strtoXmldocument($str)
{
    $dom = new DOMDocument();
    $str1 = $str;
    return $dom->loadXML($str1);
}

function stringToDataset($xmlString, $username, $password)     
{                       
    $client = new SoapClient('http://1.1.1.1/WSTEST/Service.asmx?WSDL');

    $response = $client->XmlIslet(strtoXmldocument($xmlString)->documentElement,  
strtoXmldocument("<Kullanici><Adi>" .$username. "</Adi><Sifre>" .$password. "</Sifre></Kullanici>")->documentElement);

var_dump($response);
}

stringToDataset($xmlString, $username, $password);
?>
POST /WSTEST/Service.asmx HTTP/1.1
Host: 1.1.1.1
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <XmlIslet xmlns="http://tempuri.org/">
      <xmlIslem>xml</xmlIslem>
      <xmlYetki>xml</xmlYetki>
    </XmlIslet>
  </soap12:Body>
</soap12:Envelope>
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <XmlIsletResponse xmlns="http://tempuri.org/">
      <XmlIsletResult>xml</XmlIsletResult>
    </XmlIsletResponse>
  </soap12:Body>
</soap12:Envelope>
usernamepasswordobject(stdClass)#2 (1) { ["XmlIsletResult"]=> object(stdClass)#3 (1) { ["any"]=> string(120) "falseObject reference not set to an instance of an object." } } 
========= REQUEST ========== 
string(292) 
"<?xml version="1.0" encoding="UTF-8"?> 
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://tempuri.org/">
<SOAP-ENV:Body>
<ns1:XmlIslet>
<ns1:xmlIslem/>
<ns1:xmlYetki/>
</ns1:XmlIslet>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope> "