It seems that Nusoap nested arrays are failing?

I am trying to contact TargetProcess through their Soap services. When I make a simple request, such as “read,” it works.

for instance

// Some code...
$client = soapclientnusoap(path to my service...);

$client->call("RetrieveAll");

// Get nice results...

Next .. when I try to perform a more complex operation, it works too ...

// Some code...
$client = soapclientnusoap(path to my service...);

$params = array("Name"=>"Sample project");
$client->call("CreateProject", $params);

// Get nice results...

He works too.

HOWEVER, when I nested arrays, it fails

// Some code...
$client = soapclientnusoap(path to my service...);

$params = array('entity'=>
    array("Name" => "Bug name")
);

$client->call("CreateBug", $params);

// Error..

The only difference is that the basic commands have no parameters or have one level of parameters, and the last one has nested parameters.

Any clues? !!!

Thank.

This is my fault [faultstring] => Server could not read the request. ---> There is an error in the XML document. ---> The input string was not in the correct format.

And this is a request (headers removed)

<SOAP-ENV:Body><Create xmlns="http://targetprocess.com"><entity><ID/><BugID/><Name>TEST Bug</Name><Description>Some words about the bug</Description><StartDate/><EndDate/><CreateDate>2011-02-11T17:57:21</CreateDate><ModifyDate/><LastCommentDate/><NumericPriority/><Effort/><EffortCompleted/><EffortToDo/><TimeSpent/><TimeRemain/><LastCommentUserID/><OwnerID/><LastEditorID/><EntityStateID/><PriorityID/><ProjectID>131</ProjectID><IterationID/><ParentID/><ReleaseID/><SeverityID/><BuildID/><UserStoryID/></entity></Create></SOAP-ENV:Body></SOAP-ENV:Envelope>

Notes:

  • Nusoap php5.2, , soapclient nusoap, tu soapclientnusoap.

  • php5 SoapClient, , , , , , 5 , . , , , , Nusoap.

+3

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


All Articles