I spent the last couple of days working with PHP 5 to connect to a WCF service hosted on a remote server. Its like a proof of concept… After many failed attempts at getting a PHP client to connect it happened. I got the connection and figured out how to pass a parameter to WCF and get a return value. In the process I spent a good bit of time Googling for answers.
In all my Googling, I never found any meaningful help. It was only through gleaning key pieces of information across multiple searches that I was able to get PHP to WCF to work. I really need to publish a paper on this subject, and provide some simple code to demonstrate what works. Thats for the future… in the interim here is the PHP code that works on all but my site host's server.
<?php
echo "start -> ";
$wsdl = "https://newt3services.com/Service1.svc?wsdl";
echo " set wsdl var -> ";
$soapclient = new SoapClient($wsdl);echo " created soapclient ->";
echo $soapclient->GetData(array("value" => "5"))->GetDataResult;
echo " end ";
?>
Click here to execute the code and get the correct result: execute php
Click here to execute the code and get the incorrect result:execute php
Looking forward to getting back into blogging and what better way than doing this challenge to raise awareness. Thank you for hosting!
LikeLike
I recently came across your blog and have Been reading along. I thought I would leave my first comment. I do not know what to say except that I have enjoyed reading.
LikeLike