Jump to content

Connecting to Soap Web Service


ARTIS

Recommended Posts

Hi!

 

I need to retrieve data from a WCF Web Service and don't seem to be connecting when the "new SoapClient" is called.  I am using php version 5.2.  The service requires 2 Parmameters, an account ID and a comma separated email list.  Can someone please tell me what I am doing wrong?

 

Thanks!

 

<?php
header('Content-Type: text/xml'); 

$client = new SoapClient('http://www.zbestlistings.com/WCF/Primedia.svc?wsdl');
$response = $client->GetPropertyXML(array( "AccountID" => "12807175152", "eMailList" => "[email protected], [email protected], 

[email protected]" )); 
echo   $response;

?>

Link to comment
https://forums.phpfreaks.com/topic/253816-connecting-to-soap-web-service/
Share on other sites

The response from the client is an object, you need to fetch the correct key of the object (the only key might I add)

 

The following displays what you need:

<?php
header('Content-Type: text/xml'); 

$client = new SoapClient('http://www.zbestlistings.com/WCF/Primedia.svc?wsdl');
$response = $client->GetPropertyXML(array( "AccountID" => "12807175152", "eMailList" => "[email protected], [email protected], [email protected]" )); 

echo $response->GetPropertyXMLResult;

?>

 

Regards, PaulRyan.

I just get a blank screen.  I added echo tags to pinpoint were the failure is occuring like so:

 

echo " 1  "

$client = new SoapClient('http://www.zbestlistings.com/WCF/Primedia.svc?wsdl');

echo " 2 "

$response = $client->GetPropertyXML(array( "AccountID" => "12807175152", "eMailList" => "[email protected], [email protected], [email protected]" ));

echo " 3  "

 

 

It never makes it to 2.

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.