2013-04-24

PHP: Querying Dell AssetService webservice to retrieve asset information

If you are reading this article because you stumbled upon my blog looking for information on a completely unrelated subject, you'll probably wonder what this is about. On the other hand, if you were specifically looking for information on how to query Dell's AssetService via PHP, this post will tell you exactly what to do!

Sept. 2015 update: this tutorial no longer works since Dell have updated their systems. If you manage to make it work please let us know what you did!

Dell is one of the top IT hardware supplier for professionals. The organization I currently work for has been working with Dell for over a decade: we have hundreds of Dell laptops, desktop PCs, screens, videoprojectors and whatnot. As it turns out, Dell makes use of a particular serial code that is assigned to each of the products they manufacture: it's called the "service tag".


The service tag can be found in at least three locations:
- on a label physically stuck on the item (see above picture, the back of a laptop)
- in the BIOS or menus
- on the cardboard box when you receive the item

If you know the service tag of an item, you can visit Dell's support page, enter the service tag, and you'll find all sorts of information and detail specific not only to the hardware model, but also to your particular item (warranty information etc.). Now, if you want to be allowed to retrieve such information programmatically, say, from a PHP script, you would use the very simple script below:



Let me explain what this code does.

  1. The first line ($DELL_URL...) sets the path of Dell's web service, AssetService
  2. The second line (new SoapClient...) creates a new SoapClient object specifying the WSDL URL and the option to use the SOA Protocol v1.2
  3. The third line ($tag...) specifies the service tag of the item you want to retrieve information about
  4. The last line ($response...) performs the actual request to the web service. You'll note that we're passing a dummy GUID, and the "applicationName" is arbitrarily set to "AssetService". I don't think it these two parameters make any difference.
Past this code, the item information is contained in the $response object. What can you do with this object? Let's begin with a var_dump / print_r:

This long piece of plain text details the structure of the response; you can use the following code to retrieve the information it contains:

You'll note that the $response->GetAssetInformationResult->Asset->Entitlements->EntitlementData array contains multiple elements: I am not sure that this corresponds to, but the first of these items always seems to match our warranty information.

Thank you for reading this post. If you have any more questions feel free to comment!

Search This Blog