<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Damian Beresford &#187; Windows</title>
	<atom:link href="http://www.damianberesford.com/category/windows/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.damianberesford.com</link>
	<description>My perspective on the world of software development</description>
	<lastBuildDate>Tue, 22 Mar 2011 22:47:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>&#8216;New-WebServiceProxy&#8217; cmdlet in PowerShell 2.0</title>
		<link>http://www.damianberesford.com/2009/11/09/powershell-new-webserviceproxy-cmdlet/</link>
		<comments>http://www.damianberesford.com/2009/11/09/powershell-new-webserviceproxy-cmdlet/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 20:46:42 +0000</pubDate>
		<dc:creator>Damian</dc:creator>
				<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.damianberesford.com/?p=48</guid>
		<description><![CDATA[I&#8217;ve been using PowerShell quite a bit of late, bit of a learning curve but when you get into it it really is amazingly powerful (the ability to pipe objects (and not just text) is a game changer). Hence the name I suppose! In the last while, I&#8217;ve been using PowerShell 2.0 in Windows 7, [...]]]></description>
			<content:encoded><![CDATA[<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">I&#8217;ve been using PowerShell quite a bit of late, bit of a learning curve but when you get into it it really is amazingly powerful (the ability to pipe objects (and not just text) is a game changer). Hence the name I suppose!</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">In the last while, I&#8217;ve been using PowerShell 2.0 in Windows 7, and with it the excellent &#8216;New-WebServiceProxy&#8217; cmdlet. In a nutshell, this allows you to use Web Services API&#8217;s directly from the shell, which I&#8217;m finding incredibly productive.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Here&#8217;s a short example of using a relatively non-trivial Web Service: the BetFair API.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">$bfExchange = New-WebServiceProxy -uri</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">https://api.betfair.com/exchange/v5/BFExchangeService.wsdl -Namespace</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">BFE</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">$bfGlobal = New-WebServiceProxy -uri</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">https://api.betfair.com/global/v3/BFGlobalService.wsdl -Namespace BFG</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">$loginReq = new-object BFG.LoginReq</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">$loginReq.username = &lt;your betfair username&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">$loginReq.password = &lt;your betfair password&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">$loginReq.productId = 82</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">$loginReq.vendorSoftwareId = 0</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">$loginResp = $bfGlobal.login($loginReq)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"># Get some Betfair Events, happening in the next 3 hours</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">$marketsReq = New-Object BFE.GetAllMarketsReq</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">$marketsReq.header = New-Object BFE.APIRequestHeader</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">$marketsReq.header.sessionToken = $loginResp.header.sessionToken</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">$marketsReq.fromDate = Get-Date</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">$marketsReq.toDate = (Get-Date).AddHours(3)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"># Invoke the call</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">$marketResp = $bfExchange.getAllMarkets($marketsReq)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"># The format of the Markets, etc, is all documented here:</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"># http://bdphelp.betfair.com/API6/6.0/RefGuide/wwhelp/wwhimpl/js/html/wwhelp.htm</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">foreach($market in $marketResp.marketData.Split(&#8216;:&#8217;)) {</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">$data = $market.Split(&#8216;~&#8217;)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Write-Host &#8220;Market: &#8221; $data[1] &#8220;Path: &#8221; $data[5]</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">}</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Although trivial, its a good example of &#8216;feeling your way around&#8217; an external Web Service without having to write any real code (i.e. fire up VSTS).</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">If your thinking of trying out powershell, give PowerGui a look http://www.powergui.org, and also I find Console to be way better than the default Windows cmd. I&#8217;ve also plenty of interesting Powershell links bookmarked on delicious: http://delicious.com/dberesford/powershell</div>
<p>I&#8217;ve been using <a href="http://en.wikipedia.org/wiki/Windows_PowerShell">PowerShell</a> quite a bit of late, bit of a small learning curve but when you get into it it really is amazingly powerful (hence the name I suppose!). The ability to pipe objects, and not just text, makes it excellent &#8216;glue&#8217; for which to bind things together (e.g. data in SQL Server, Excel, Email, your own .NET components/services, etc).</p>
<p>In the last while, I&#8217;ve been using PowerShell 2.0 in Windows 7, and with it the excellent <a href="http://msdn.microsoft.com/en-us/library/microsoft.powershell.commands.newwebserviceproxy(VS.85).aspx">&#8216;New-WebServiceProxy&#8217;</a> cmdlet. This allows you to use Web Service API&#8217;s directly from the shell, which I&#8217;m finding incredibly useful. (You could do this in Powershel 1.0 but it was a bit more <a href="http://www.leeholmes.com/blog/CallingAWebserviceFromPowerShell.aspx">involved</a>)</p>
<p>Here&#8217;s a short example of using a relatively non-trivial Web Service, the <a href="http://bdp.betfair.com/">BetFair API</a>:</p>
<p><code>#short script to log on to Betfair and grab some upcoming events</code></p>
<p><code>$bfExchange = New-WebServiceProxy -uri https://api.betfair.com/exchange/v5/BFExchangeService.wsdl -Namespace BFE</code></p>
<p><code>$bfGlobal = New-WebServiceProxy -uri https://api.betfair.com/global/v3/BFGlobalService.wsdl -Namespace BFG</p>
<p>$loginReq = new-object BFG.LoginReq</p>
<p>$loginReq.username = &lt;your betfair username&gt;</p>
<p>$loginReq.password = &lt;your betfair password&gt;</p>
<p>$loginReq.productId = 82</p>
<p>$loginReq.vendorSoftwareId = 0</p>
<p>$loginResp = $bfGlobal.login($loginReq)</p>
<p># Get some Betfair Events, happening in the next 3 hours</p>
<p>$marketsReq = New-Object BFE.GetAllMarketsReq</p>
<p>$marketsReq.header = New-Object BFE.APIRequestHeader</p>
<p>$marketsReq.header.sessionToken = $loginResp.header.sessionToken</p>
<p>$marketsReq.fromDate = Get-Date</p>
<p>$marketsReq.toDate = (Get-Date).AddHours(3)</p>
<p># Invoke the call</p>
<p>$marketResp = $bfExchange.getAllMarkets($marketsReq)</p>
<p># The format of the Markets, etc, is all documented here:</p>
<p># http://bdphelp.betfair.com/API6/6.0/RefGuide/wwhelp/wwhimpl/js/html/wwhelp.htm</p>
<p>foreach($market in $marketResp.marketData.Split(':')) {</p>
<p>$data = $market.Split('~')</p>
<p>Write-Host "Market: " $data[1] "Path: " $data[5]</p>
<p>}</p>
<p></code></p>
<p>Although trivial, its a good example of &#8216;feeling your way around&#8217; an external Web Service without having to write any real code (i.e. fire up VSTS).</p>
<p>If your thinking of trying out powershell, give <a href="http://www.powergui.org">PowerGui</a> a look, and I also  find <a href="http://sourceforge.net/projects/console/">Console</a> to be way better than the default Windows cmd. I&#8217;ve also plenty of Powershell links bookmarked on <a href="http://delicious.com/dberesford/powershell">delicious</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.damianberesford.com/2009/11/09/powershell-new-webserviceproxy-cmdlet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows build of &#8216;PJSUA&#8217;</title>
		<link>http://www.damianberesford.com/2009/09/21/windows-build-of-pjsua/</link>
		<comments>http://www.damianberesford.com/2009/09/21/windows-build-of-pjsua/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 15:59:36 +0000</pubDate>
		<dc:creator>Damian</dc:creator>
				<category><![CDATA[Mini-projects]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.damianberesford.com/?p=41</guid>
		<description><![CDATA[I was doing a bit of research into SIP development and I struggled to find to pre-built binary for PJSUA (a sample console application for the excellent PJSIP) for windows. There are quite a few steps involved in building PJSIP on windows, so if anyone is looking for a pre-built binary for PJSUA for windows, here it [...]]]></description>
			<content:encoded><![CDATA[<p>I was doing a bit of research into <a href="http://en.wikipedia.org/wiki/Session_Initiation_Protocol">SIP</a> development and I struggled to find to pre-built binary for <a href="http://www.pjsip.org/pjsip/docs/html/page_pjsip_samples_pjsua.htm">PJSUA</a> (a sample console application for the excellent <a href="http://www.pjsip.org">PJSIP</a>) for windows.</p>
<p>There are quite a few steps involved in <a href="http://www.pjsip.org/using.htm#vs">building PJSIP on windows</a>, so if anyone is looking for a pre-built binary for PJSUA for windows, <a href="http://www.damianberesford.com/files/pjsua-i386-Win32-vc8-Release.zip">here</a> it is. It&#8217;s built with <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=c17ba869-9671-4330-a63e-1fd44e0e2505&amp;displaylang=en">MS SDK 7</a>, and version 2914 of the pjsip trunk.</p>
<p>Although it is billed as a reference application, PJSUA is really quite comprehensive in terms of functionality, and works very well when run against my <a href="http://www.blueface.ie/">Blueface</a> account.</p>
<p>Many thanks to everyone behind the PJSIP project, I hope to use it in earnest in the near future.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.damianberesford.com/2009/09/21/windows-build-of-pjsua/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

