james2008 Posted March 15, 2010 Share Posted March 15, 2010 Hi, I'm trying to create a SOAP client that access a Coldfusion Web service. The service returns an XML document. Here's the specs for accessing the Web service: Parameters AccountID Numeric, required (Assigned to you by InstantService) UserID String, required, UserID (Assigned to you by InstantService) Password String, required (Assigned to you by InstantService) ReturnType String, required: base64 or normal The following is an example of the returned XML (refer to the Standard Export format document for an explanation of the data fields): <cfinvoke webservice = "https://ws.instantservice.com/isws/LookupTableData.cfc?wsdl" method = "GetDepartment" returnVariable = "returnedXML" > <cfinvokeargument name="AccountID" value="5000"> <cfinvokeargument name="UserID" value="yourid"> <cfinvokeargument name="Password" value="yourpass"> <cfinvokeargument> Here's what I've came up with. It seems to connect alright, but nothing is being returned. Any help is appreciaed: <?php $arguments = array( 'AccountID'=> 1759, 'UserID' => 'ctiedu', 'Password' => '47355' ); $client = new soapclient('https://ws.instantservice.com/isws/lookuptabledata.cfc?wsdl'); // Call RemoteFunction () $error = 0; try { // get catch error when trying to pass arguments in as array, so just passing each as a param. The functin is GetDepartment $test = $client->__call("GetDepartment",1759,'ctiedu','47355'); echo 'made it here' ; print_r($test->returnedXML); } catch (SoapFault $fault) { $error = 1; echo 'Returned the following ERROR: ' .$fault->faultcode . '-' . $fault->faultstring ; } // kill object unset($client); ?> Link to comment https://forums.phpfreaks.com/topic/195344-problem-figuring-out-a-simple-soap-client/ Share on other sites More sharing options...
james2008 Posted March 15, 2010 Author Share Posted March 15, 2010 Nevermind, I figured it out: <?php $arguments = array( 'AccountID'=> 1759, 'UserID' => 'citiedu', 'Password' => '47355', 'ReturnType' => 'xml' ); $client = new soapclient('https://ws.instantservice.com/isws/lookuptabledata.cfc?wsdl'); // Call RemoteFunction () $error = 0; try { $result = $client->__call('GetDepartment', $arguments); } catch (SoapFault $fault) { $error = 1; echo 'Returned the following ERROR: ' .$fault->faultcode . '-' . $fault->faultstring ; } print_r($result); // kill object unset($client); Link to comment https://forums.phpfreaks.com/topic/195344-problem-figuring-out-a-simple-soap-client/#findComment-1026547 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.