XML not generated at soap request php

Amurbduro

New Member
I am trying to pass some arguments to a Soap client and receive a response and the arguments that I want to pass are:
\[code\] $newargs->USERNAME = $this->username; $newargs->PASSWORD = $this->password; $newargs->LANGUAGEUID = $this->convertSystem2ProviderLanguage($args->language); $newargs->CITYUID = $args->city; $newargs->CHECKIN = date("Y-m-d",$args->checkin); $newargs->CHECKOUT = date("Y-m-d",$args->checkout); $newargs->ROOMS = new stdClass(); $newargs->ROOMS->ROOM = array(); foreach($args->rooms as $room){ $newroom = new stdClass(); $newroom->ADULTS = $room->adults; $newroom->CHILDREN = $room->children; for($j=1;$j<=$room->children;$j++){ $var = "CHILDAGE{$j}"; $newroom->$var = $room->childage[$j]; } $newargs->ROOMS->ROOM[] = $newroom; }\[/code\]
And I use a build function to send the request like this:
\[code\]$response = $this->sendSoapRequest($this->url,$newargs,"GETAVAILABILITY");\[/code\]And this is the function:
\[code\]public function sendSoapRequest($url,$args,$function){ $client = new SoapClient($url,array( "trace"=>true )); try { $result = $client->{$function}($args); } catch(Exception $e){ log_message("error","SOAP CLIENT: ".print_r($client,true)); log_message("error","SOAP EXCEPTION: ".print_r($e,true)); log_message("error","SOAP REQUEST GENERATED XML: ".print_r($client->__getLastRequest(),true)); die("SOAP REQUEST ERROR"); return ""; } return $result;}\[/code\]And the thing that I receive is this: \[code\]SoapException: Server was unable to process request. ---> System.NullReferenceException: Object reference not set to an instance of an object.\[/code\]. And I see that in _last_request the XML did not appear. Can anyone tell me why is that?
The WSDL link is correct and tested it but I don't seem to get any result.
 
Back
Top