PowerShell & BlackBerry 10 Web Services (Part 1 – Preparation)

This is a follow-up to my previous four-part post about PowerShell & BlackBerry Web Services. If you need a primer on where this is coming from, see the first series.

Like before, I’m going to run through each step that I used when setting this up, though there will be fewer references to the specifics at each stage. Most (if not all of the preparation stages) are covered in the previous post.

Quick Note:When I refer to BlackBerry 10 Web Services, I’m specifically talking about the Web Services for BlackBerry devices (aka the BlackBerry Device Service). I’ll probably cover something later with the Universal Device Service for Android and iOS devices, but that falls outside the scope of this current post.

I started out like I did with everything for the previous post, I started with the samples made available via BlackBerry on GitHub. The full list of pages are here and the sample from which I constructed my script is here.

If you don’t want to go through all of these steps one-by-one, I’ll provide a download of the C# file with this posting.

Step 1) Download the WSDL Files

Like before, I needed to download the WSDL files and play with them slightly. What I did this time was slightly different. I used wget.exe to download the two files. The important part is that you get the files.

Step 2) Generate the BES 10 Proxy C# File

I copied the WSDL Files down to a webserver that I operated. Then you can just create the C# Code by using the wsdl.exe program in your Microsoft SDK Folder.

“C:Program Files (x86)Microsoft SDKsWindowsv7.0ABinwsdl.exe” /sharetypes /o:C:ScriptsBlackBerryBes10Proxy.cs /Namespace:BWS http://webserver.domain.local/Bes10WebServices.wsdl http://webserver.domain.local/Bes10UtilWebServices.wsdl

This will generate a C# file (that mentioned after the /o parameter).

Step 3) Compile the C# File to a DLL

Use the csc.exe program from one of your .NET Framework Folders to convert the C# code to a DLL file.

“C:WindowsMicrosoft.NETFramework64v4.0.30319csc.exe” /target:library /optimize+ /out:C:ScriptsBlackBerryBes10Proxy.dll C:ScriptsBlackBerryBes10Proxy.cs

Step 4) Congratulate yourself

Cheater Method:

Step 1) Download my C# file and remove the “.txt” from the end. Edit line #162 and #31919 and replace the generic URLs with those for your BlackBerry Administration Service.

Step 2) Compile the C# file to a DLL (see the above step 3 for the syntax).

Part 2 of this post will be the first code that I’ve written for the BlackBerry 10 Web Services.

4 thoughts on “PowerShell & BlackBerry 10 Web Services (Part 1 – Preparation)

Leave a Comment