MetaSys Software Posted August 27, 2010 Posted August 27, 2010 Does any one have sample code to consume web service using 360 works web service manager in PHP,say for 'AddTwoNumbers' operation? here is code which we wrote require_once('lib/nusoap.php'); $wsdl ="http://servername/websvcmgr.php?wsdl&service=ExampleService"; $client=new soapclient($wsdl, 'wsdl'); $param=array('addend1'=>'15', 'addend2'=>'10'); $result = $client->call('AddTwoNumbers', $param); // Check for a fault if ($client->fault) { echo ' Fault '; print_r($result); echo ''; } else { // Check for errors $err = $client->getError(); if ($err) { // Display the error echo ' Error ' . $err . ''; } else { // Display the result echo ' Result '; print_r($result); echo ''; } } This does execute 'display result' code, but no output value is shown.
Jesse Barnum Posted September 8, 2010 Posted September 8, 2010 I replied privately to this, here is the PHP code to access our test server if anybody else is trying to do this: <?php $soap = new SoapClient('http://wpeoffice.360works.com/websvcmgr.php?wsdl&Service=ExampleService'); $lookup = $soap->AddTwoNumbers(array("Addend1" => "3", "Addend2" => "4")); print_r( $lookup ); ?>
Recommended Posts
This topic is 5189 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now