Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $client = new SoapClient("http://www.scottnichol.com/samples/hellowsdl2.php?wsdl&debug=1",array(
- "trace"=>1,
- "exceptions"=>0)
- );
- //$req->firstname="Scott";
- //$req->age="50";
- //$req->gender="M";
- //$parameters->person = $req;
- $obj = $client->hello(array('firstname'=>"Scott",'age'=>"50",'gender'=>"M"));
- //$xml = simplexml_load_string($client->__getLastResponse());
- $xml = simplexml_load_string($client->__getLastRequest());
- //$xml = new SimplexmlElement($client->__getLastResponse(), TRUE);
- $json= json_encode($xml);
- //$json= json_encode($client->__getLastResponse());
- print "<pre>\n";
- print "<br />\n Request : ".htmlspecialchars($client->__getLastRequest());
- print "<br />\n Response: ".htmlspecialchars($client->__getLastResponse());
- print "<br />\n xml: ".$xml;
- print "<br />\n JSON: ".$json;
- print "</pre>";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment