resumeParse HttpResponseCode=200 error

Forum for users and developers of Bullhorn's Webservices API suite

Moderators: StaffingSupport, s.emmons, BullhornSupport

Post Reply
chrisd66
User
Posts: 2
Joined: Wed Oct 26, 2011 6:28 pm

resumeParse HttpResponseCode=200 error

Post by chrisd66 » Wed Oct 26, 2011 6:35 pm

I am using PHP to try to parse a resume and I am receiving the following error:

[diagnostics] => HttpResponseCode=200
InitStatus=null
InitStatusStr=null
StellentStatus=null
StellentStatusStr=null
RexStatus=null
RexStatusStr=null

[success] => false


Below is a snippet of my code:

if( empty($this->apiSession) )
parent::createBullhornInstance();

$parseResumeOperation = array('session' => $this->apiSession,
'base64ChunkedResume' => $this->resumeContentBase64);

$result = $this->BHclient->call('parseResume',$parseResumeOperation);

// refresh session
$this->apiSession = $result['return']['session'];

$success = $result['return']['success'];
$diagnostics = $result['return']['diagnostics'];
$hrXml = $result['return']['hrXml'];

Any help would be appreciated.

k.pham
User
Posts: 21
Joined: Thu Jun 24, 2010 5:13 pm

Re: resumeParse HttpResponseCode=200 error

Post by k.pham » Thu Oct 27, 2011 1:48 pm

Your code looks fine to me. Not sure what you've done to get $resumeContentBase64 but it should be as simple as below:

$handle = fopen($filename, "r");
$fileBinary = fread($handle, filesize($filename));
fclose($handle);

$base64ChunkedResume = base64_encode($fileBinary);

chrisd66
User
Posts: 2
Joined: Wed Oct 26, 2011 6:28 pm

Re: resumeParse HttpResponseCode=200 error

Post by chrisd66 » Fri Oct 28, 2011 4:50 pm

Below are the 2 methods that I am using to send the resume. The SOAP client I am using is nuSOAP.
Without any more information as to why this process is failing on Bullhorn's side, I do not know how to debug and make this work.

public function getFileContents($files) {
// check that the file is the correct type
$fNameRev = strrev($files['attachment1']['name']);

$a = explode('.',$fNameRev);
$fileType = strrev($a[0]);

if( in_array($fileType,$this->acceptedFileTypes) ) {

if( $files['attachment1']['size'] > 0 ) {
$handle = fopen($files['attachment1']['tmp_name'], "r");
$this->resumeContent = fread($handle, filesize($files['attachment1']['tmp_name']));
fclose($handle);

$this->resumeContentBase64 = base64_encode($this->resumeContent);
$this->resumeContent = '';
} else {
return 'file is empty';
}

} else {
return 'bad file type';
}

return 'success';
}


public function sendForParsing() {

if( empty($this->apiSession) )
parent::createBullhornInstance();

$parseResumeOperation = array('session' => $this->apiSession,
'base64ChunkedResume' => $this->resumeContentBase64);

$result = $this->BHclient->call('parseResume',$parseResumeOperation);

//echo '<pre>'; print_r($result); echo '</pre>';
// refresh session
$this->apiSession = $result['return']['session'];

$success = $result['return']['success'];
$diagnostics = $result['return']['diagnostics'];
$hrXml = $result['return']['hrXml'];

// echo '<pre>'; print_r($hrXml); echo '</pre>';
}

k.pham
User
Posts: 21
Joined: Thu Jun 24, 2010 5:13 pm

Re: resumeParse HttpResponseCode=200 error

Post by k.pham » Wed Nov 02, 2011 10:25 am

Hi Chris,

I use php_soap and php 5.0 to run this code and it works fine for me. I haven't tried nuSoap yet but will see if I could make it work.

Code: Select all

if ($_FILES["file"]["error"] > 0)
  {
  echo "Error: " . $_FILES["file"]["error"] . "<br />";
  }
else
  {
  $filename = $_FILES["file"]["tmp_name"];
  }
$handle = fopen($filename, "r");
$fileBinary = fread($handle, filesize($filename));
fclose($handle);

//Converting to base64
$base64ChunkedResume = base64_encode($fileBinary);

$params = array('trace' => 1,
		'soap_version' => SOAP_1_1);
		$BHclient = new SoapClient("https://api.bullhornstaffing.com/webservices-2.0/?wsdl",$params);
		
// To run this code, you will need a valid username, password, and API key.
$username = "";
$password = "";
$apiKey = "";
		
// Start a new session
$session_request = new stdClass();
$session_request->username = $username;
$session_request->password = $password;
$session_request->apiKey = $apiKey;
$API_session = $BHclient->startSession($session_request);
$API_currentSession = $API_session->return->session;

$API_request_parseResume_operation = array(
	'session' => $API_currentSession,
	'base64ChunkedResume' =>$base64ChunkedResume,
);

try {
$API_response__parseResume_operation = $BHclient->parseResume($API_request_parseResume_operation);
}
catch (SoapFault $fault) {
	var_dump($BHclient->__getLastRequest());
	die($fault->faultstring);
	}

$API_currentSession = $API_response__parseResume_operation->return->session;
$success = $API_response__parseResume_operation->return->success;	
$diagnostics = $API_response__parseResume_operation->return->diagnostics;
$hrXml = $API_response__parseResume_operation->return->hrXml;

echo "<br/>";
echo "Success: ".$success;
echo "Diagnostics: ".$diagnostics;



Post Reply