...">

What is "any" in wsdl and how can I call the wsdl function with php?

This code is a small part of my wsdl. Here I do not understand

<s:sequence> <s:any/> </s:sequence> 

Please tell me what kind of

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

using php, I call this function below, this is my code

  $client = new SoapClient("some.wsdl"); $params = array("any"=>''); $result = $client->CalculStudents(array('doc'=>$params)); 

but he gives an error

  Exception Error! Server was unable to process request.Object reference not set to an instance of an object. 

Tell me how to solve it. Is the error when calling php or wsdl wrong?

+4
source share
2 answers

In an XML schema, the any element is a way of specifying "any non-empty sequence of elements in general."

So you have WSDL: "This method can accept any data at all and can potentially return any data." This is obviously completely fake, and you are a little better than without WSDL. Your only way out at this point is to yell at the API seller and pray that you end up with useful documentation.

+1
source
 <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 

skip: don’t try to verify these elements (by searching for a scheme) lax: trying to verify, but don’t complain if you cannot find the strict scheme: trying to verify and error if you cannot find the scheme

 $params = array("id"=>'',"maxOccurs"=>'',"minOccurs"=>'',"namespace"=>'',"processContents"=>''); $result = $client->__soapCall("CalculStudents",array("any"=>$params)); 
0
source

Source: https://habr.com/ru/post/1481250/


All Articles