SOAP in PHP without SoapClient (cURL, NuSOAP?)

Discussion about Schedules Direct grabber code and data formats.
Post Reply
seileef
Posts: 1
Joined: Fri Feb 13, 2009 2:27 pm

SOAP in PHP without SoapClient (cURL, NuSOAP?)

Post by seileef »

Hi,
I'm a bit new to SOAP and haven't been able to successfully get a result using either cURL or NuSOAP (the SoapClient class isn't available on my server). Does anyone have any code that does this? It doesn't necessarily have to use cURL or NuSOAP, it just can't use SoapClient.

I think I'm getting the closest with NuSOAP; the following code gets an error of "wsdl error: urn:TMSWebServices:dateTime (dateTime) is not a supported type." at the "<h2>Error</h2>" line.

Code: Select all

<?php
require_once('lib/nusoap.php');

$username='myusername';
$password='mypassword';
$data_url='http://docs.tms.tribune.com/tech/tmsdatadirect/schedulesdirect/tvDataDelivery.wsdl';

$client = new soapclient($data_url, true);

$client->setCredentials($username, $password);
$err = $client->getError();
if ($err) {
	echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
}

$start=gmdate("Y-m-d\TH:i:s\Z",time());
$stop =gmdate("Y-m-d\TH:i:s\Z",time()+3600*24);

$param = array('startTime' => $start, 'stopTime' => $stop);

$result = $client->call('download', $param);

if ($client->fault) {
	echo '<h2>Fault</h2><pre>';
	print_r($result);
	echo '</pre>';
} else {
	$err = $client->getError();
	if ($err) {
		echo '<h2>Error</h2><pre>' . $err . '</pre>';
	} else {
		echo '<h2>Result</h2><pre>';
		print_r($result);
		echo '</pre>';
	}
}
echo '<h2>Request</h2><pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
echo '<h2>Response</h2><pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';

?>
Any ideas?

rmeden
SD Board Member
Posts: 1527
Joined: Tue Aug 14, 2007 2:31 pm
Location: Cedar Hill, TX
Contact:

Re: SOAP in PHP without SoapClient (cURL, NuSOAP?)

Post by rmeden »

Try

$param = array($start,$stop)

Instead of the parameter names.. maybe that will cause it to ignore the types. I think I did something similar in perl once.

Also, check out the "sample soap request" in the "official example" thread. Either try and make nuSOAP match it, or just use a HTTP PUT to send it and generate the SOAP yourself.

Robert

rjwbn1
Posts: 1
Joined: Sat May 02, 2009 2:01 am

Re: SOAP in PHP without SoapClient (cURL, NuSOAP?)

Post by rjwbn1 »

Hi.

Did anyone manage to solve this issue as I am getting exactly the same error?

Thanks

Richard

alwayslate
Posts: 8
Joined: Thu Jun 16, 2011 10:48 am

Re: SOAP in PHP without SoapClient (cURL, NuSOAP?)

Post by alwayslate »

rjwbn1 wrote:Hi.

Did anyone manage to solve this issue as I am getting exactly the same error?

Thanks

Richard
Bumping this old thread in a little bit of frustration. i was happy to find the thread doing a forum search, but was bummed it stopped at nothing. Any information on this fix would be beneficial to my moving forward with filling out my IT resume. I have been working on a cloud strategy for storing my video files, and this is a new technology so I am not sure exactly how the integration works in this specific instance. Any help would be great before I contact the IT staffing agency.

Post Reply