Page 1 of 1

DTD are not supported by SOAP (Bullhorn Server timing out?)

Posted: Wed Jul 27, 2011 7:06 pm
by bhforuminquery
I am getting random "DTD are not supported by SOAP" error messages when querying the bullhorn server for ANYTHING at all. I've looked this message up and it appears that it's most common cause is "Receiving HTML back" instead of a real Soap response. Generally this seems to be a 403 or 404 error. I am guessing that it's receiving a "Server Busy" error page or something. This is a serious pain because I cant seem to stop if from breaking the PHP code. Everytime I get this error, PHP stops dead and exits. I really need it to "retry" instead. But ideally of course, these errors wouldnt even come up. Below is the error I get. Remember, this only happens randomly. I can refresh, and get a response back 3 or 4 times before this message pops up again. So it's got nothing to do with the actual code itself.

Also something to note is that any queries to bullhorn take EXCEPTIONALLY long periods of time. In excess of 60-90 seconds, even for queries that only return ONE result.

<b>Fatal error</b>: Uncaught SoapFault exception: [Client] DTD are not supported by SOAP in /home/site/public_html/sites/all/modules/custom/site_bullhorn/site_bullhorn.module:365
Stack trace:
#0 /home/site/public_html/sites/all/modules/custom/site_bullhorn/site_bullhorn.module(365): SoapClient->__call('find', Array)
#1 /home/site/public_html/sites/all/modules/custom/site_bullhorn/site_bullhorn.module(365): SoapClient->find(Array)
#2 /home/site/public_html/sites/all/modules/custom/site_bullhorn/site_bullhorn.module(330): bullhorn_query(Array)
#3 /home/site/public_html/sites/all/modules/custom/site_bullhorn/site_bullhorn.module(230): site_get_jobs_from_bullhorn()
#4 /home/site/public_html/sites/all/modules/custom/site_bullhorn/site_bullhorn.module(59): site_save_jobs_to_db(true)
#5 [internal function]: site_bullhorn_init()
#6 /home/site/public_html/includes/ call_user_func_array('site_bullhorn...', Array)
#7 /home/site/public_html/includes/ module_inv in <b>/home/site/public_html/sites/all/modules/custom/site_bullhorn/site_bullhorn.module</b> on line <b>365</b><br />

Line 365 is below, look for: findResult = $BHClient->find($query); // LINE 365 IS RIGHT HERE

Code: Select all

function bullhorn_query($query, $distinct = FALSE, $api_type = '1.1')
   //Get a valid session ID for this query.
   //$sid = get_bullhorn_sid();

   //All queries require a 'distinct' element for the 2.0 API so we add that here and default it to OFF.
   $query['distinct'] = $distinct;

   //Default params for accessing the WSDL service.
   $params = array(
   'trace'  => 1,
   'soap_version'  => SOAP_1_1

   //Initialize a connection to the service
   //$BHClient = new SoapClient(BULLHORN_WSDL_URL, $params);
   $session = create_bullhorn_session($api_type);
   $BHClient = $session->BHClient;

   //Bullhorn only has 2 types of queries.  Lists of data or complete data object based on ID.  We sort these out here.

   if ($query['id'])
      $findId = new SoapVar($query['id'], XSD_INTEGER, "int", "");
      $query['id'] = $findId;  //Replace the php int with a soap int.  Without this it complains about bad int type.
      $findResult = $BHClient->find($query);   // LINE 365 IS RIGHT HERE
      return $findResult->return->dto;
      $SOAP_query = new SoapVar($query,  SOAP_ENC_OBJECT, "dtoQuery", "");
      //Put together a request for the results of the above query and give it a session id, maybe the query isnt actually completed until this step? I dont know.
      $request_array = array (
      'session'  => $session->API_session->return,
      'query'  => $SOAP_query

      //Get the results
      $SOAP_request = new SoapVar($request_array,  SOAP_ENC_OBJECT, "query", "");
      $queryResult = $BHClient->query($SOAP_request);
      return $queryResult->return;

Re: DTD are not supported by SOAP (Bullhorn Server timing out?)

Posted: Wed Jul 27, 2011 7:12 pm
by bhforuminquery
Erm, I think this is in the wrong forum. If you could move it and reply that would be great thanx.

Re: DTD are not supported by SOAP (Bullhorn Server timing out?)

Posted: Thu Jul 28, 2011 9:50 am
by apsmith

Can you give me a couple examples (datestamps) when those errors were delivered so that we can check the logs for the cause of the error, perhaps there may be something that we can determine from a better error on our side.

Re: DTD are not supported by SOAP (Bullhorn Server timing out?)

Posted: Thu Jul 28, 2011 5:36 pm
by bhforuminquery
Yea, how about right now lol. 5:32PM'ish EST. I just refreshed to see if I could get he error and sure enough, on the first try, I got that error. The username was: brian.reynolds and it was a query for all jobs (about 30 or 40 results total should have been the result) using this query:

//The $query_array appears as follows:
$query = array(
'entityName' => 'JobOrder',
'maxResults' => $limit,
'parameters' => array()

$limit was set to 200000. I have played with the limit and it doesnt matter what it's set to. 1 or 200000, I get that error regardless.

Call me crazy, but I believe it does this when the connection to the server has been idle for X amount of time. It's like the bullhorn server decides I've been away for to long and I dont need access right away. If I refresh, I get results. If I continue to refresh, I will intermittently get the DTD error. This tells me that the bullhorn server is being overloaded with queries and is rejecting some queries.\

If you check that log, you will see that at 5:41'ish PM, I successfully processed the query I just mentioned. But at 5:32pm EST, that exact same query FAILED with an unknown HTML error that I have no idea on how to read.

Re: DTD are not supported by SOAP (Bullhorn Server timing out?)

Posted: Fri Jul 29, 2011 2:07 pm
by bhforuminquery
If you have suggestions on how I could see the HTML that the soap client is receiving, then this problem could probably be nailed down very easily. I'm sure it says something worth reading.

Re: DTD are not supported by SOAP (Bullhorn Server timing out?)

Posted: Mon Aug 01, 2011 10:45 am
by apsmith

I did not see anything useful in our logs that would help here, as far as reading the packet. Have you tried some testing outside of your source code to see if you can manually reproduce the error? If so, it is often easy to add debugging or logging to files that can show the whole stack trace.

For testing, have you tried using a tool like SOAP UI, this is free tool that i use to push requests to the APIs at an XML level. If you are receiving bad XML back, this should allow you to see the exact packet, even if it is corrupt in some way.