Latest photo: Keeping it sharp

Notification for Your Mailboxes

Search my site

Web Development

Salesforce SOAP API and PHP

December 3, 2011

Lately, I’ve been doing a lot of work integrating a Drupal content management system with Salesforce through it’s SOAP API. Along the way, I’ve come across many stumbling blocks in getting both systems to interact and simply play nice.

Some of the features included extending Drupal’s authentication and authorization to happen between both systems, and building a front-end in Drupal that allows users to interact with and manipulate data residing on Salesforce.

Enough of the small talk, let’s start with the basics and get a connection going to Salesforce using PHP, and run some cool functionality.

PHP: Loading XML locally or externally

November 27, 2011

I came across this issue on Saturday, and I’m totally stumped. I’ll explain the issue and maybe someone can confirm that I’m not losing my mind.

I’ve set up two web servers on a LAMP stack; one public facing and the other internal used for testing. The site gets data from Salesforce and uses their SOAP API. In the configuration file, I reference the username, password, and location of the WSDL file as a URL. It’s been working fine for the past few months, up until Saturday night. The error I receive is.

PHP Fatal error:  SOAP-ERROR: Parsing WSDL:
Couldn't load from 'http://domain.com/soapclient/partner.wsdl.xml'
Failed to load external entity "http://domain.com/soapclient/partner.wsdl.xml" in
/var/www/soapclient/SforceBaseClient.php on line 57

SEO and owning your last name on Google

June 8, 2011

SEO (search engine optimization) is most possibly the key word on the tips of every marketers tongue. My understanding of it is that you position your content in such a way that search engines can better find you and analyze the effectiveness of your data. So, little things such as headings (and its various levels h1/h2/h3/h4), description and keywords all come into play.

I initially launched this blog after having an interesting conversation with a friend, Rob Jama, about resumes in general. He joked about the possibility of ditching resumes completely, and just having a business card that shows Google’s search box with your name in it. This would only work if

Forcing PDF files to download

April 23, 2011

Recently, I was dealing with a rather dumb issue between various browsers and how they display/download PDF files. What was dumb was that one browser would display an error when the file originates from a CDN, while when locally available on the same server, no issues. Let’s not forget, visa versa for the other browser.

First thing I managed to do was reach out to the browser and CDN in question on twitter, hoping this was a known issue. With my luck, no go. So, let’s just force a file download and avoid the headache all in all. We’ll call this getfile.php.

Integrating old forum tags into Drupal

February 25, 2011

Recently, I had to import two old forums into Drupal. One of the forums had its own tagging system, such as [B] and [U] for bold and underline. The thing about forum content is that everything is stored in the database. So, when a forum post is opened, you would see the [B] and [U] and it wouldn’t mean anything, unless you wrote a module that would make sense of it.

For PHP developers out there, it would be enough to simply implement a string search on pages before they get sent to the browser and have it converted to standard HTML code. What about tackling the problem at the source and convert all those tags at the source? I came across an interesting MySQL function that allows you to search for a string and replace all occurrences, thereby, avoiding the added overhead with a PHP function that would do this for you.