这段代码是我的wsdl的一小部分。这里我还没明白
<s:sequence>
<s:any/>
</s:sequence>
请告诉我这是什么
<s:element name="CalculStudents">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="doc">
<s:complexType mixed="true">
<s:sequence>
<s:any/>
</s:sequence>
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>
使用 php 我正在调用这个函数,下面是我的代码
$client = new SoapClient("some.wsdl");
$params = array("any"=>'');
$result = $client->CalculStudents(array('doc'=>$params));
但它抛出了一个错误
Exception Error! Server was unable to process
request.Object reference not set to an instance of an object.
告诉我如何解决这个问题。这是 php 调用错误还是 wsdl 错误?
在 XML Schema 中,any
元素是一种指定"任何非空元素序列"的方法。
所以你拥有的 WSDL 是说,"此方法可以接受任何数据,并且可能返回任何数据。这显然是完全虚假的,而且你比没有WSDL的情况好不了多少。此时,您唯一的办法是对 API 供应商大喊大叫,并祈祷您最终获得有用的文档。
<xs:any>
id = xs:ID
maxOccurs = ( xs:nonNegativeInteger | “unbounded” ) : “1”
minOccurs = xs:nonNegativeInteger : “1”
namespace = ( (“##any” | “##other” ) | list of (xs:anyURI | “##targetNamespace” | “##local”) ) ) : “##any”
processContents = (“skip” | “lax” | “strict”) : “strict”
##any: any element from any namespace
##other: any element from any namespace other than the target
##targetNamespace: any element from the target
跳过:不要尝试验证这些元素(通过查找架构)LAX :尝试验证,但如果找不到架构,请不要抱怨严格:如果找不到架构,请尝试验证并出错
$params = array("id"=>'',"maxOccurs"=>'',"minOccurs"=>'',"namespace"=>'',"processContents"=>'');
$result = $client->__soapCall("CalculStudents",array("any"=>$params));