ARTIS Posted December 25, 2011 Share Posted December 25, 2011 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; ?> Quote Link to comment https://forums.phpfreaks.com/topic/253816-connecting-to-soap-web-service/ Share on other sites More sharing options...
PaulRyan Posted December 26, 2011 Share Posted December 26, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/253816-connecting-to-soap-web-service/#findComment-1301292 Share on other sites More sharing options...
ARTIS Posted December 26, 2011 Author Share Posted December 26, 2011 Thank you Paul! I am guessing your tried this and an xml string was returned to you? I am still not getting anything and am wondering if there is may be a server configuration or something that I am missing. Quote Link to comment https://forums.phpfreaks.com/topic/253816-connecting-to-soap-web-service/#findComment-1301301 Share on other sites More sharing options...
PaulRyan Posted December 26, 2011 Share Posted December 26, 2011 I tested this on my local server, I have allowed more things than usually applies to an online web host. What exactly is your error? What is on the screen when this code has run? Regards, PaulRyan. Quote Link to comment https://forums.phpfreaks.com/topic/253816-connecting-to-soap-web-service/#findComment-1301327 Share on other sites More sharing options...
ARTIS Posted December 26, 2011 Author Share Posted December 26, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/253816-connecting-to-soap-web-service/#findComment-1301328 Share on other sites More sharing options...
ARTIS Posted December 26, 2011 Author Share Posted December 26, 2011 Also, If you are getting data back, that tells me that it is not a problem with the web service. Quote Link to comment https://forums.phpfreaks.com/topic/253816-connecting-to-soap-web-service/#findComment-1301329 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.