Jump to content

Never connected to SOAP before


Presto-X

Recommended Posts

I am trying to connect to a list of customer testimonials via SOAP and I have never had to use SOAP before so I can no clue what I’m doing lol, I did some searching on Google, but I have not been able to get anything working.  Once I get a response in XML I will be good to go, please please please if you can spare a few minutes to give a hand.

 

The owner of the dataset had this to say “The call you want is GetQuotes. The first parameter for the call includes an ID (the value of which is {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}) and the number of quotes you want returned.

 

This is my code so far, from what I have found off of Google

$client = new SoapClient("http://www.somedomain.com/cgi-bin/testimonials.DLL/SOAP");
echo '<pre>';
print_r($client->GetQuotes(array('id' => '{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}')));
echo '</pre>';

Link to comment
https://forums.phpfreaks.com/topic/261911-never-connected-to-soap-before/
Share on other sites

the way the person responded is worded awkwardly, the first parameter contains 1 thing and another thing? I think he means two parameters?

I would try $client->GetQuotes('{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}', 5); to get 5 quotes, assuming you replaced {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} with an appropriate ID.

 

 

Thanks so much for the replys guys,

 

Here is my current code, yes I replaced my X's with the correct key.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<?PHP

$client = new SoapClient("http://www.somedomain.com/cgi-bin/testimonials.DLL/SOAP");
echo '<pre>';
print_r($client->GetQuotes('{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}', 5));
echo '</pre>';

?>
</body>
</html>

 

I get the following error, this is the same error I was getting this morning, driving me crazy lol

Fatal error:  Uncaught SoapFault exception: [Exception] Data access invalid in /home/XXXXX/public_html/test/soap.php:13

Stack trace:

#0 /home/XXXXX/public_html/test/soap.php(13): SoapClient->__call('GetQuotes', Array)

#1 /home/XXXXX/public_html/test/soap.php(13): SoapClient->GetQuotes('{D198A589-55E0-...', 5)

#2 {main}

  thrown in /home/XXXXX/public_html/test/soap.php on line 13

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.