slow SoapClient instantiation

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

Moderators: StaffingSupport, s.emmons, BullhornSupport

Post Reply
Alliance
User
Posts: 40
Joined: Mon Feb 18, 2013 12:16 pm

slow SoapClient instantiation

Post by Alliance » Thu Mar 28, 2013 4:50 pm

I am creating a Job List page for my company. The page takes about 25 seconds to load. I started investigating the long load time and narrowed it down to one single call:

Code: Select all

$this->bh_client = new SoapClient(BH_WSDL,$params);
The rest of the operation, including the query and fetch of open JobOrders, was less than 1 second.

The BH_WSDL was pointing to a local copy of the WSDL. I changed it to point to https://api.bullhornstaffing.com/webservices-2.5/?wsdl and my load times decreased to about 8 seconds from 25 seconds. Substantially better, but 8 seconds is still too long to make a page visitor wait.

I ran across http://stackoverflow.com/questions/7506 ... emely-slow this post about slow SoapClient constructor.
In one of the comments it is suggested to set the cache_wsdl parameter to WSDL_CACHE_MEMORY.

I implemented this and now my params array looks like this:

Code: Select all

        // config params
        $params = array(
            'trace'        => 1,
            'soap_version' => SOAP_1_1,
            'cache_wsdl'   => WSDL_CACHE_MEMORY
        );
I was elated when the Job List page loaded in less than 1 second. Unfortunately, this is not consistent. Examining the execution times of the individual calls, sometimes the new SoapClient call executes very quickly, in less than one second. Sometimes it executes slowly, taking about 8 seconds. I don't know why it is inconsistent.

Can anyone help? Bullhorn, is there a recommended practice on caching the WSDL? For every page view of the Job List, the SoapClient object is re-created. Is this the wrong tactic? Should I be saving this resource somehow and referencing it instead of creating a new SoapClient and calling startSession() on it for every page view?

tericson
User
Posts: 5
Joined: Wed Dec 31, 1969 8:00 pm

Re: slow SoapClient instantiation

Post by tericson » Fri Apr 12, 2013 4:59 pm

Hello,

Bullhorn recommends that you cache the information locally on your server, and then utilize events to update the jobs.
Tracy Ericson
Enterprise Support Analyst
B U L L H O R N
Staffing and Recruiting Software, On Target, On Demand
33-41 Farnsworth Street, 5th Floor, Boston, MA 02210
617-478-9126 (main)

Post Reply