tag:blogger.com,1999:blog-26758364078189061352024-03-13T11:38:28.451-07:00SmartNova SoftwareService-Oriented Architecture (SOA), Web Services and Cloud ComputingUnknownnoreply@blogger.comBlogger20125tag:blogger.com,1999:blog-2675836407818906135.post-5402870009945484732011-05-18T14:34:00.000-07:002011-05-18T14:34:19.831-07:00Google REST Web Service Security C# URL Authentication<div style="font-family: inherit;"><span style="font-size: small;"><b>Google URL Signing</b></span></div><div style="font-family: inherit;"><span style="font-size: small;"><b> </b></span> </div><div style="font-family: inherit;"><span style="font-size: small;">To access certain Google API web services a Client ID and a digital signature is required. A Client ID and a cryptographic key (used to generate a unique digital signature) are provided by Google once consumers have created an account. Before a REST web service request can be made, a digital signature must be generated and passed in as part of the URL, this process is known as URL signing. The cryptographic key, sometimes called shared secret/signing key must be kept secret and is never passed in as part of a URL request. </span></div><div style="font-family: inherit;"><span style="font-size: small;"><br />
</span></div><div style="font-family: inherit;"><span style="font-size: small;"><b>The following are required before a digital signature can be generated:</b></span></div><div style="font-family: inherit;"><br />
</div><div style="font-family: inherit;"><span style="font-size: small;"><b></b></span></div><div style="font-family: inherit;"></div><ul><li><span style="font-size: small;">A signing string (made up of the path and query of the request URL).</span></li>
<li><span style="font-size: small;">A signing key (cryptographic key provided by Google). </span></li>
<li><span style="font-size: small;">The correct encryption algorithm (Hash Message Access Control eg. HMAC SHA1, HMAC SHA2).</span></li>
</ul><div style="font-family: inherit;"><span style="font-size: small;"></span></div><div style="font-family: inherit;"><br />
</div><div style="font-family: inherit;"><span style="font-size: small;"><b>To generate a digital signature requires the following 3 steps.</b></span></div><div style="font-family: inherit;"><br />
</div><div style="font-family: inherit;"><b><span style="font-size: small;">1) Construct request URL, the URL must be percent-encoded/URL encoded to ensure it is valid.</span></b></div><div style="font-family: inherit;"><span style="font-size: small;"><br />
</span></div><div style="font-family: inherit;"><span style="font-size: small;"><b>Constructing a valid URL</b></span></div><div style="font-family: inherit;"><br />
</div><div style="font-family: inherit;"><span style="font-size: small;">A URL is made up of reserved and unreserved characters. Reserved characters in a URL have a specific purpose, for example a ‘/ ’ separates the different parts of a URL. If a ‘/ ’ is required in a URL for any other purpose, then it must be percent-encoded to distinguish it from its reserved counterparts. Percent-encoded reserved characters are always preceded by a ‘%’ to indicate percent-encoding.</span></div><div style="font-family: inherit;"><span style="font-size: small;"><br />
</span></div><div style="font-family: inherit;"><span style="font-size: small;">The following are reserved characters:</span></div><div style="font-family: inherit;"><span style="font-size: small;"><br />
</span></div><div style="font-family: inherit;"><span style="font-size: small;">! * ' ( ) ; : @ & = + $ , / ? % # [ ]</span></div><div style="font-family: inherit;"><span style="font-size: small;"><br />
</span></div><div style="font-family: inherit;"><span style="font-size: small;">To percent-encode a URL’s reserved characters, use the pair of hex digits which corresponds to each reserved character’s ASCII value, finish by preceding each hex digit pair with a ‘%’. If any reserved character is non-ASCII then use the pair of hex digits which corresponds to its UTF-8 character instead. </span></div><div style="font-family: inherit;"><span style="font-size: small;"><br />
</span></div><div style="font-family: inherit;"><span style="font-size: small;">For example, to percent-encode a '/ ':</span></div><div style="font-family: inherit;"><span style="font-size: small;"><br />
</span></div><div style="font-family: inherit;"><span style="font-size: small;">a) convert to or look up the ASCII value for a ‘/ ’, the ASCII value is 47 </span></div><div style="font-family: inherit;"><span style="font-size: small;"><br />
</span></div><div style="font-family: inherit;"><span style="font-size: small;">b) next look up the pair of hex digits which correspond to this ASCII value, the hex digit pair is 2F</span></div><div style="font-family: inherit;"><span style="font-size: small;"><br />
</span></div><div style="font-family: inherit;"><span style="font-size: small;">c) next precede with a ‘%’, the result is %2F</span></div><div style="font-family: inherit;"><span style="font-size: small;"><br />
</span></div><div style="font-family: inherit;"><span style="font-size: small;">URL encoding the following URL:</span></div><div style="font-family: inherit;"><span style="font-size: small;"><br />
</span></div><div style="font-family: inherit;"><span style="font-size: small;">http://maps.googleapis.com/maps/api/geocode/json ?address=East 25th St & 3rd Ave&sensor=false&client=yourClientID</span></div><div style="font-family: inherit;"><span style="font-size: small;"><br />
</span></div><div style="font-family: inherit;"><span style="font-size: small;">The address parameter contains spaces, spaces are not allowed in a URL, it also contains a '&'. This URL must be encoded by replacing spaces with a '+', and replacing '&' with the two hex digits corresponding to its ASCII value. </span></div><div style="font-family: inherit;"><span style="font-size: small;"><br />
</span></div><div style="font-family: inherit;"><span style="font-size: small;">Encoding would produce the following URL: </span></div><div style="font-family: inherit;"><span style="font-size: small;"><br />
</span></div><div style="font-family: inherit;"><span style="font-size: small;">http://maps.googleapis.com/maps/api/geocode/json?address=East+25th+St+%26+3rd+Ave&sensor=false&client=yourClientID</span></div><div style="font-family: inherit;"><span style="font-size: small;"><br />
</span></div><div style="font-family: inherit;"><span style="font-size: small;">For more information on ASCII characters and their corresponding pair of hex digits see the following link:</span></div><div style="font-family: inherit;"><span style="font-size: small;"><br />
</span></div><div style="font-family: inherit;"><span style="font-size: small;"><a href="http://en.wikipedia.org/wiki/American_Standard_Code_for_Information_Interchange">http://en.wikipedia.org/wiki/American_Standard_Code_for_Information_Interchange</a></span></div><div style="font-family: inherit;"><span style="font-size: small;"><br />
</span></div><div style="font-family: inherit;"><span style="font-size: small;">To see a list of reserved/unreserved characters and additional information on URL usage, go to the following link.</span></div><div style="font-family: inherit;"><span style="font-size: small;"><br />
</span></div><div style="font-family: inherit;"><span style="font-size: small;"><a href="http://tools.ietf.org/html/rfc3986#section-2.2">http://tools.ietf.org/html/rfc3986#section-2.2</a></span></div><div style="font-family: inherit;"><span style="font-size: small;"><br />
</span></div><div style="font-family: inherit;"><b><span style="font-size: small;">2) Using the encoded URL</span></b></div><div style="font-family: inherit;"><span style="font-size: small;"><br />
</span></div><div style="font-family: inherit;"><span style="font-size: small;">http://maps.googleapis.com/maps/api/geocode/json?address=East+25th+St+%26+3rd+Ave&sensor=false&client=yourClientID</span></div><div style="font-family: inherit;"><span style="font-size: small;"><br />
</span></div><div style="font-family: inherit;"><span style="font-size: small;">Omit the protocol and host, leaving only the path and query, now you have the signing string.</span></div><div style="font-family: inherit;"><span style="font-size: small;"><br />
</span></div><div style="font-family: inherit;"><span style="font-size: small;">/maps/api/geocode/json?address=East+25th+St+%26+3rd+Ave&sensor=false&client=yourClientID</span></div><div style="font-family: inherit;"><span style="font-size: small;"><br />
</span></div><div style="font-family: inherit;"><b><span style="font-size: small;">3) Generate signature using signing key, signing string and encryption algorithm.</span></b></div><div style="font-family: inherit;"><span style="font-size: small;"><br />
</span></div><div style="font-family: inherit;"><span style="font-size: small;">Google provides a C# method for developers called ‘Sign’, this method accepts two string parameters and returns the signed URL request in full as a string. When calling this method the full URL and the signing key are passed in as the two parameters of type string, see the method below.</span></div><div style="font-family: inherit;"><span style="font-size: small;"><br />
</span></div><div style="font-family: inherit;"><span style="font-size: small;"><b>Google’s C# 'Sign' method code snippet </b></span></div><div style="font-family: inherit;"><span style="font-size: small;"><br />
</span></div><div style="font-family: inherit;"><span style="font-size: small;">public static string Sign(string url, string keyString) </span></div><div style="font-family: inherit;"><span style="font-size: small;">{</span></div><div style="font-family: inherit;"><span style="font-size: small;"> ASCIIEncoding encoding = new ASCIIEncoding();</span></div><div style="font-family: inherit;"><span style="font-size: small;"> // converting key to bytes will throw an exception, need to</span></div><div style="font-family: inherit;"><span style="font-size: small;"> // replace '-' and '_' characters first.</span></div><div style="font-family: inherit;"><span style="font-size: small;"><br />
</span></div><div style="font-family: inherit;"><span style="font-size: small;"> string usablePrivateKey = keyString.Replace("-", "+").Replace("_", "/");</span></div><div style="font-family: inherit;"><span style="font-size: small;"><br />
</span></div><div style="font-family: inherit;"><span style="font-size: small;"> byte[] privateKeyBytes = Convert.FromBase64String(usablePrivateKey);</span></div><div style="font-family: inherit;"><span style="font-size: small;"><br />
</span></div><div style="font-family: inherit;"><span style="font-size: small;"> Uri uri = new Uri(url);</span></div><div style="font-family: inherit;"><span style="font-size: small;"><br />
</span></div><div style="font-family: inherit;"><span style="font-size: small;"> byte[] encodedPathAndQueryBytes = encoding.GetBytes(uri.LocalPath + uri.Query);</span></div><div style="font-family: inherit;"><span style="font-size: small;"><br />
</span></div><div style="font-family: inherit;"><span style="font-size: small;"> // compute the hash</span></div><div style="font-family: inherit;"><span style="font-size: small;"><br />
</span></div><div style="font-family: inherit;"><span style="font-size: small;"> HMACSHA1 algorithm = new HMACSHA1(privateKeyBytes);</span></div><div style="font-family: inherit;"><span style="font-size: small;"><br />
</span></div><div style="font-family: inherit;"><span style="font-size: small;"> byte[] hash = algorithm.ComputeHash(encodedPathAndQueryBytes);</span></div><div style="font-family: inherit;"><span style="font-size: small;"><br />
</span></div><div style="font-family: inherit;"><span style="font-size: small;"> // convert the bytes to string and make url-safe by replacing '+' and '/' characters</span></div><div style="font-family: inherit;"><span style="font-size: small;"><br />
</span></div><div style="font-family: inherit;"><span style="font-size: small;"> string signature = Convert.ToBase64String(hash).Replace("+", "-").Replace("/", "_");</span></div><div style="font-family: inherit;"><span style="font-size: small;"><br />
</span></div><div style="font-family: inherit;"><span style="font-size: small;"> // Add the signature to the existing URI.</span></div><div style="font-family: inherit;"><span style="font-size: small;"><br />
</span></div><div style="font-family: inherit;"><span style="font-size: small;"> return uri.Scheme+"://"+uri.Host+uri.LocalPath + uri.Query +"&signature=" + signature;</span></div><div style="font-family: inherit;"><span style="font-size: small;">}</span></div><div style="font-family: inherit;"><span style="font-size: small;"><br />
</span></div><div style="font-family: inherit;"><span style="font-size: small;">A signature parameter is attached to the end of the URL, and the fully signed request URL is returned as a string.</span></div><div style="font-family: inherit;"><span style="font-size: small;"><br />
</span></div><div style="font-family: inherit;"><span style="font-size: small;">http://maps.googleapis.com/maps/api/geocode/json?address=East+25th+St+%26+3rd+Ave&sensor=false&client=yourClientID&signature=HMACgeneratedSignature</span></div><div style="font-family: inherit;"><span style="font-size: small;"><br />
</span></div><div style="font-family: inherit;"><span style="font-size: small;">Using this process a request can be made to any Google web service which requires a digital signature.</span></div><div style="font-family: inherit;"><span style="font-size: small;"><br />
</span></div><div style="font-family: inherit;"><span style="font-size: small;">To download Google's C# console application for URL signing, which includes the 'Sign' method shown above, see the following link:</span></div><div style="font-family: inherit;"><span style="font-size: small;"><br />
</span></div><div style="font-family: inherit;"><span style="font-size: small;"><a href="http://gmaps-samples.googlecode.com/svn/trunk/urlsigning/UrlSigner.cs">http://gmaps-samples.googlecode.com/svn/trunk/urlsigning/UrlSigner.cs</a></span></div><div style="font-family: inherit;"><span style="font-size: small;"><br />
</span></div><div style="font-family: inherit;"><span style="font-size: small;">In some cases SSL (Secure Socket Layer) is used to provide transport level security when making requests. In these situations change the protocol from ‘http’ to ‘https’, before making the request.</span></div><div style="font-family: inherit;"><span style="font-size: small;"><br />
</span></div><div style="font-family: inherit;"><span style="font-size: small;">Google Maps API Web Services require URL Authentication, documentation is provided on the URL signing process, how to produce valid URL's, SSL Access and processing XML results. See the following link for more information:</span></div><div style="font-family: inherit;"><span style="font-size: small;"><br />
</span></div><div style="font-family: inherit;"><span style="font-size: small;"><a href="http://code.google.com/apis/maps/documentation/webservices/index.html">http://code.google.com/apis/maps/documentation/webservices/index.html</a></span></div>Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2675836407818906135.post-36641580415310718772011-05-18T14:33:00.001-07:002011-05-18T14:33:48.832-07:00Yahoo REST Web Service Security<div style="font-family: inherit;"><span style="font-size: small;"><b>Yahoo REST Web Service Authentication</b></span></div><div style="font-family: inherit;"><br />
<span style="font-size: small;">All Yahoo API web services are free to consume at present. Once service consumers have signed up for an account with Yahoo, they are assigned an API Key/Application ID. When making a REST web service call the API Key must be included in the URL request.</span></div><div style="font-family: inherit;"><br />
<span style="font-size: small;">Some Yahoo API web services use basic http authentication if a username and password is required, the Delicious API from Yahoo is an example. The http <b>Authorization</b> header is assigned the value of the base64 encoded username and password. A client with the following credentials:</span><br />
<span style="font-size: small;"><br />
</span></div><div style="font-family: inherit;"><span style="font-size: small;">username = MyUserName</span></div><div style="font-family: inherit;"><span style="font-size: small;">password = MyPsswd</span></div><div style="font-family: inherit;"><br />
<span style="font-size: small;">Places the username and password together to create the following string, which is then encoded using base64.</span></div><div style="font-family: inherit;"><br />
<span style="font-size: small;">MyUserName:MyPsswd </span></div><div style="font-family: inherit;"><span style="font-size: small;"><br />
</span></div><div style="font-family: inherit;"><span style="font-size: small;">The resulting base64 encoded string is passed as a http header during the request, for example:</span></div><div style="font-family: inherit;"><br />
<span style="font-size: small;">Authorization: Basic TXlVc2VyTmFtZTpNeVBzc3dk</span></div><div style="font-family: inherit;"><br />
<span style="font-size: small;">The Delicious API also uses Secure Socket Layer (SSL) for transport level security, the https protocol is used instead of http when making a request. Some service providers use HTTP-Auth and SSL in combination.</span></div>Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2675836407818906135.post-45695734335934481972011-05-18T14:33:00.000-07:002011-05-21T12:48:53.644-07:00Amazon Web Services (AWS) URL Authentication<div style="font-family: inherit;"><span lang="EN" style="font-size: small; line-height: 115%;">There are two types of web service requests that can be made to Amazon Web Services (AWS).</span><br />
<span lang="EN" style="font-size: small; line-height: 115%;"><br />
</span></div><ul style="font-family: inherit;"><li><span lang="EN" style="font-size: small; line-height: 115%;"><b>Anonymous requests</b> are made to freely available services using an Access Key ID which is issued when consumers sign up for an account. This key is included as a request parameter in all requests made to AWS. </span></li>
</ul><ul><li><span lang="EN" style="font-size: small; line-height: 115%;"><b>Authenticated requests</b> must contain a request signature, in other words the URL must be signed using a generated digital signature.</span></li>
</ul><ul style="font-family: inherit;"></ul><div style="font-family: inherit;"><span lang="EN" style="font-size: small; line-height: 115%;"><br />
<b>AWS Access Identifiers</b> are an Access Key ID which is your identity/username and a Secret Access Key which is your password. The Secret Access Key must be kept secret and is never used in requests, it is instead used together with an encryption algorithm during the signing process. The Secret Access Key is a 40 character alphanumeric sequence issued to consumers by AWS.</span><br />
<span lang="EN" style="font-size: small; line-height: 115%;"><br />
</span><br />
<span lang="EN" style="font-size: small; line-height: 115%;"><b>A Recipe for Signing URL Request’s to AWS</b> <br />
<br />
<b>1) Construct your request URL.</b></span><br />
<span lang="EN" style="font-size: small; line-height: 115%;"><b><br />
</b>The following is a dummy URL<br />
<br />
http://aws.amazon.com/onca/xml?Service=AWSDummyService&AWSAccessKeyId=00000000&Operation=DummySearch&ResponseGroup=DummyInfo,TopSellers,NewReleases&Version=2011-05-05 <br />
<br />
<b>2) TimeStamp your URL.</b></span></div><br />
Attach a time stamp to the end of your URL.<br />
<br />
<span lang="EN" style="font-size: small; line-height: 115%;"><a href="http://aws.amazon.com/onca/xml?Service=AWSDummyService&AWSAccessKeyId=00000000&Operation=DummySearch&ResponseGroup=DummyInfo,TopSellers,NewReleases&Version=2011-05-05&TimeStamp=2011-5-03T14:22:58Z"><span style="color: black;">http://aws.amazon.com/onca/xml?Service=AWSDummyService&AWSAccessKeyId=00000000&Operation=DummySearch&ResponseGroup=DummyInfo,TopSellers,NewReleases&Version=2011-05-05&<b>TimeStamp=2011-5-03T14:22:58Z</b></span></a></span><span lang="EN" style="font-size: small; line-height: 115%;"><span lang="EN" style="font-size: 14pt; line-height: 115%;"><span style="font-size: small;"></span></span></span><br />
<br />
<span lang="EN" style="font-size: small; line-height: 115%;"><span lang="EN" style="font-size: 14pt; line-height: 115%;"><span style="font-size: small;">For more info on UTC format TimeStamp, see the link below.</span></span></span><br />
<span lang="EN" style="font-size: small; line-height: 115%;"><br />
<span lang="EN" style="font-size: 14pt; line-height: 115%;"><span style="font-size: small;"><a href="http://en.wikipedia.org/wiki/Unix_time">http://en.wikipedia.org/wiki/Unix_time</a></span></span><br />
<br />
<b>3) URL encode any reserved characters used by query parameters.</b><br />
<br />
The ResponseGroup parameter contains comma’s and the TimeStamp parameter contains colons, comma’s and colons are reserved characters. To URL encode a reserved character, use the hex digit pair corresponding to the reserved character’s ASCII value, then precede the hex digit pair with a ‘%’. <br />
<br />
Reserved Character Hex Digit Pair<br />
, %2C<br />
: %3A<br />
<br />
The URL encoded dummy URL:<br />
<br />
<a href="http://aws.amazon.com/onca/xml?Service=AWSDummyService&AWSAccessKeyId=00000000&Operation=DummySearch&ResponseGroup=DummyInfo%2CTopSellers%2CNewReleases&Version=2011-05-05&TimeStamp=2011-5-03T14%3A22%3A58Z"><span style="color: black;">http://aws.amazon.com/onca/xml?Service=AWSDummyService&AWSAccessKeyId=00000000&Operation=DummySearch&ResponseGroup=DummyInfo<b>%2</b>CTopSellers<b>%2</b>CNewReleases&Version=2011-05-05&TimeStamp=2011-5-03T14<b>%</b>3A22<b>%</b>3A58Z</span></a><br />
<br />
<span lang="EN" style="font-size: small; line-height: 115%;"><span lang="EN" style="font-size: 14pt; line-height: 115%;"><span style="font-size: small;"><b>4) Re-arrange URL query parameters in byte order to produce the canonical string.</b></span></span></span></span><br />
<div style="font-family: inherit;"><br />
</div><span lang="EN" style="font-size: small; line-height: 115%;"><span lang="EN" style="font-size: 14pt; line-height: 115%;"><span style="font-size: small;">Capital letters come before lower case letters. A parameter name beginning with the capital letter 'D' precedes a parameter name beginnig with 'a', the names are NOT in alphabetical order.</span></span></span><br />
<br />
<span lang="EN" style="font-size: small; line-height: 115%;"><span lang="EN" style="font-size: 14pt; line-height: 115%;"><span style="font-size: small;">Dummy URL query parameters in byte order:</span></span></span><br />
<br />
<span lang="EN" style="font-size: small; line-height: 115%;"><span lang="EN" style="font-size: 14pt; line-height: 115%;"><span style="font-size: small;">AWSAccessKeyId=00000000&Operation=DummySearch&ResponseGroup=DummyInfo%2CTopSellers%2CnewReleases&Service=AWSDummyService&TimeStamp=2011-5-03T14%3A22%3A58Z&Version=2011-05-05</span></span></span><br />
<br />
<span lang="EN" style="font-size: small; line-height: 115%;"><span lang="EN" style="font-size: 14pt; line-height: 115%;"><span style="font-size: small;">The above is the canonicalized query string used to generate a signature.</span></span></span><br />
<br />
<span lang="EN" style="font-size: small; line-height: 115%;"><span lang="EN" style="font-size: 14pt; line-height: 115%;"><span style="font-size: small;"><b>5) Prepend Verb, Host and Path lines (preceding canonicalized query string) with a line break.</b></span></span></span><br />
<br />
<span lang="EN" style="font-size: small; line-height: 115%;"><span lang="EN" style="font-size: 14pt; line-height: 115%;"><span style="font-size: small;">HTTP Verb – GET, PUT, POST, DELETE or other </span></span></span><br />
<span lang="EN" style="font-size: small; line-height: 115%;"><span lang="EN" style="font-size: 14pt; line-height: 115%;"><span style="font-size: small;">Host - aws.amazon.com </span></span></span><br />
<span lang="EN" style="font-size: small; line-height: 115%;"><span lang="EN" style="font-size: 14pt; line-height: 115%;"><span style="font-size: small;">Path - /onca/xml (if the path is empty, use a / in its place) </span></span></span><br />
<br />
<span lang="EN" style="font-size: small; line-height: 115%;"><span lang="EN" style="font-size: 14pt; line-height: 115%;"><span style="font-size: small;">Each of the verb, host and path values must be on separate lines, and they must precede the canonicalized query string.</span></span></span><br />
<br />
<span lang="EN" style="font-size: small; line-height: 115%;"><span lang="EN" style="font-size: 14pt; line-height: 115%;"><span style="font-size: small;"><b>6) The signing string in full.</b></span></span></span><br />
<br />
<span lang="EN" style="font-size: small; line-height: 115%;"><span lang="EN" style="font-size: 14pt; line-height: 115%;"><span style="font-size: small;">PUT</span></span></span><br />
<span lang="EN" style="font-size: small; line-height: 115%;"><span lang="EN" style="font-size: 14pt; line-height: 115%;"><span style="font-size: small;">aws.amazon.com</span></span></span><br />
<span lang="EN" style="font-size: small; line-height: 115%;"><span lang="EN" style="font-size: 14pt; line-height: 115%;"><span style="font-size: small;">/onca/xml</span></span></span><br />
<span lang="EN" style="font-size: small; line-height: 115%;"><span lang="EN" style="font-size: 14pt; line-height: 115%;"><span style="font-size: small;">AWSAccessKeyId=00000000&Operation=DummySearch&ResponseGroup=DummyInfo%2CTopSellers%2CnewReleases&Service=AWSDummyService&TimeStamp=2011-5-03T14%3A22%3A58Z&Version=2011-05-05</span></span></span><br />
<br />
<span lang="EN" style="font-size: small; line-height: 115%;"><span lang="EN" style="font-size: 14pt; line-height: 115%;"><span style="font-size: small;"><b>7) Compute digital signature using signing string, Secret Access/Signing Key and a hash algorithm.</b></span></span></span><br />
<br />
<span lang="EN" style="font-size: small; line-height: 115%;"><span lang="EN" style="font-size: 14pt; line-height: 115%;"><span style="font-size: small;">The encryption algorithm can be HMAC SHA1 or SHA256. Amazon provides code samples in a variety of languages available to download for their Flexible Payment Service, the samples include code for generating digital signatures, see the following link.</span></span></span><br />
<br />
<span lang="EN" style="font-size: small; line-height: 115%;"><span lang="EN" style="font-size: 14pt; line-height: 115%;"><span style="font-size: small;"><a href="http://docs.amazonwebservices.com/AmazonFPS/2008-09-17/FPSBasicGuide/index.html?APPNDX_CodeSamples.html">http://docs.amazonwebservices.com/AmazonFPS/2008-09-17/FPSBasicGuide/index.html?APPNDX_CodeSamples.html</a></span></span></span><br />
<br />
<span lang="EN" style="font-size: small; line-height: 115%;"><span lang="EN" style="font-size: 14pt; line-height: 115%;"><span style="font-size: small;">For more information on the Secure Hash Algorithm (SHA) see the following link.</span></span></span><br />
<br />
<span lang="EN" style="font-size: small; line-height: 115%;"><span lang="EN" style="font-size: 14pt; line-height: 115%;"><span style="font-size: small;"><a href="http://en.wikipedia.org/wiki/SHA_hash_functions">http://en.wikipedia.org/wiki/SHA_hash_functions</a></span></span></span><br />
<br />
<span lang="EN" style="font-size: small; line-height: 115%;"><span lang="EN" style="font-size: 14pt; line-height: 115%;"><span style="font-size: small;"><b>8) URL encode reserved characters in the signature.</b></span></span></span><br />
<br />
<span lang="EN" style="font-size: small; line-height: 115%;"><span lang="EN" style="font-size: 14pt; line-height: 115%;"><span style="font-size: small;">+ and = characters in the signature must be replaced by hex digit pairs.<br />
<br />
<b>9) Create a signed request by attaching the signature to the end of the request URL.</b></span></span></span><br />
<br />
<span lang="EN" style="font-size: small; line-height: 115%;"><span lang="EN" style="font-size: 14pt; line-height: 115%;"><span style="font-size: small;">http://aws.amazon.com/onca/xml? AWSAccessKeyId=00000000&Operation=DummySearch&ResponseGroup=DummyInfo%2CTopSellers%2CnewReleases&Service=AWSDummyService&TimeStamp=2011-5-03T14%3A22%3A58Z&Version=2011-05-05&Signature=URLencodedSignature</span></span></span><br />
<span lang="EN" style="font-size: small; line-height: 115%;"><br />
<span lang="EN" style="font-size: 14pt; line-height: 115%;"><span style="font-size: small;">The above recipe can be used for Amazon's Product Advertising API and Amazon's Flexible Payment Service. For more information on the product advertising API see this link.</span></span><br />
<br />
<span lang="EN" style="font-size: 14pt; line-height: 115%;"><span style="font-size: small;"><a href="http://docs.amazonwebservices.com/AWSECommerceService/latest/DG/index.html?CHAP_Intro_AAWS.html">http://docs.amazonwebservices.com/AWSECommerceService/latest/DG/index.html?CHAP_Intro_AAWS.html</a></span></span><br />
<br />
<span lang="EN" style="font-size: 14pt; line-height: 115%;"><span style="font-size: small;">Sending a signature as a URL query parameter is not the only way to sign requests, a signature can be sent instead by using the Authorization header. See below for an explanation on how this is achieved using Amazon's S3 storage service.</span></span></span><br />
<span lang="EN" style="font-size: 14pt; line-height: 115%;"><span style="font-size: small;"><br />
<b>Sending signed requests to Amazon S3 storage service</b><br />
<br />
If the signature is sent as a header, it must be set out as follows:<br />
<br />
Authorization: AWS AWSAccesskeyId : generatedSignature<br />
<br />
When using an Authorization header for authentication, the format of the signing string should be as follows:<br />
<br />
VERB + \n<br />
<br />
+ CONTENT-MD5 header value + \n<br />
<br />
+ CONTENT-TYPE header value + \n<br />
<br />
+ DATE header value + \n<br />
<br />
+ AmzHeaders names and values in lower case and in alphabetical order + \n<br />
<br />
+ Resource<br />
<br />
The format of a signing string when using query string authentication instead of an Authorization header involves a minimal change, replace the DATE header value with an Expires parameter value. The Expires parameter value indicates when you want the signature to expire.<br />
<br />
The Amzheaders are any headers that start with x-amz-.<br />
<br />
The string to sign must be URL encoded (UTF-8 encoded).<br />
<br />
The content-type and content-md5 values are optional, if their values are not included in the string, newlines (\n) must still be included where the values would have been placed.<br />
<br />
The resource value is the bucket and key values separated by a '/ '.<br />
<br />
For more information on S3 signed requests see the following link:<br />
<br />
<a href="http://s3.amazonaws.com/doc/s3-developer-guide/RESTAuthentication.html">http://s3.amazonaws.com/doc/s3-developer-guide/RESTAuthentication.html</a></span> </span>Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2675836407818906135.post-37823573148141811332011-02-21T10:37:00.000-08:002011-02-21T10:37:45.576-08:00Working with XML in C# .NET 3.5 Using XElement, xmlTrees and LINQ to XML<b>XElement</b> <br />
The XElement class represents an XML element. All elements in XML have names, they may or may not have attributes or content. <br />
<br />
The namespace System.Xml.Linq is required when working with XElement.<br />
<br />
The following link provides information on the different types of content an XElement can contain.<br />
<br />
<a href="http://msdn.microsoft.com/en-us/library/bb943882%28v=VS.90%29.aspx">http://msdn.microsoft.com/en-us/library/bb943882(v=VS.90).aspx</a><br />
<br />
For more information on the XElement class from the Microsoft site see the following link. <br />
<br />
<a href="http://msdn.microsoft.com/en-us/library/system.xml.linq.xelement%28v=VS.90%29.aspx">http://msdn.microsoft.com/en-us/library/system.xml.linq.xelement(v=VS.90).aspx</a><br />
<br />
The following link provides details on members the XElement type exposes.<br />
<br />
<a href="http://msdn.microsoft.com/en-us/library/system.xml.linq.xelement_members%28v=VS.90%29.aspx">http://msdn.microsoft.com/en-us/library/system.xml.linq.xelement_members(v=VS.90).aspx</a><br />
<br />
<b>To create a single XML element with no content:</b><br />
<br />
XElement objXElement = new XElement("Element1");<br />
<br />
objXElement now contains the following XML:<br />
<br />
<pre style="background: none repeat scroll 0% 0% rgb(255, 255, 255); color: black;"><span style="color: #808030;"><</span>Element1 <span style="color: #808030;">/</span><span style="color: #808030;">></span></pre><div style="background: none repeat scroll 0% 0% rgb(255, 255, 255); color: black;"><br />
</div><div style="background: none repeat scroll 0% 0% rgb(255, 255, 255); color: black;"><br />
</div><div style="background: none repeat scroll 0% 0% rgb(255, 255, 255); color: black;"></div><div style="background: none repeat scroll 0% 0% rgb(255, 255, 255); color: black;"></div><b>To add content to the element:</b><br />
<br />
XElement obXjElement = new XElement("Element1", "ABCD");<br />
<br />
objXElement now contains the following XML:<br />
<br />
<pre style="background: none repeat scroll 0% 0% rgb(255, 255, 255); color: black;"><span style="color: #808030;"><</span>Element1<span style="color: #808030;">></span>ABCD<span style="color: #808030;"><</span><span style="color: #808030;">/</span>Element1<span style="color: #808030;">></span>
</pre><br />
<br />
<br />
<b>To create a parent element with a descendant, add a new XElement object as the content argument:</b><br />
<br />
XElement objXElement = new XElement("Parent", new XElement( "ChildElement1","ABCD");<br />
<br />
objXElement now contains the following XML:<br />
<br />
<pre style="background: none repeat scroll 0% 0% rgb(255, 255, 255); color: black;"><span style="color: #808030;"><</span>Parent<span style="color: #808030;">></span>
<span style="color: #808030;"> <</span>ChildElement1<span style="color: #808030;">></span>ABCD<span style="color: #808030;"><</span><span style="color: #808030;">/</span>ChildElement1<span style="color: #808030;">></span>
<span style="color: #808030;"><</span><span style="color: #808030;">/</span>Parent<span style="color: #808030;">></span>
</pre><br />
<br />
The XML produced matches the standard XML format. <br />
<br />
As more XElements objects are added as content arguments an xmlTree can be created.<br />
<br />
In addition to the XElement class, there is also a XDocument class which can be used to create XML documents. The following link provides information on this class from the Microsoft site.<br />
<br />
<a href="http://msdn.microsoft.com/en-us/library/system.xml.linq.xdocument%28v=VS.90%29.aspx">http://msdn.microsoft.com/en-us/library/system.xml.linq.xdocument(v=VS.90).aspx</a><br />
<br />
Working with XElement is far simpler than working with XDocument objects. <br />
<br />
<b>xmlTree</b> <br />
<b></b> <br />
The following code snippet creates an xmlTree. <br />
<br />
<br />
XElement xmlTreeExample =<br />
<br />
new XElement(“Parents”, <br />
<br />
new XElement("Parent", <br />
<br />
new XElement( "ChildElement1","ABCD"),<br />
<br />
new XElement(“ChildElement2”,<br />
<br />
new XElement(“GrandChildElement1”, “1234”)<br />
<br />
)<br />
)<br />
);<br />
<br />
<b>xmlTreeExample now contains the following XML:</b><br />
<br />
<pre style="background: none repeat scroll 0% 0% rgb(255, 255, 255); color: black;"><span style="color: #808030;"><</span>Parents<span style="color: #808030;">></span>
<span style="color: #808030;"> <</span>Parent<span style="color: #808030;">></span>
<span style="color: #808030;"> <</span>ChildElement1<span style="color: #808030;">></span>ABCD<span style="color: #808030;"><</span><span style="color: #808030;">/</span>ChildElement1<span style="color: #808030;">></span>
<span style="color: #808030;"> <</span>ChildElement2<span style="color: #808030;">></span>
<span style="color: #808030;"> <</span>GrandChildElement1<span style="color: #808030;">></span><span style="color: #008c00;">1234</span><span style="color: #808030;"><</span><span style="color: #808030;">/</span>GrandChildElement1<span style="color: #808030;">></span>
<span style="color: #808030;"> <</span><span style="color: #808030;">/</span>ChildElement2<span style="color: #808030;">></span>
<span style="color: #808030;"> <</span><span style="color: #808030;">/</span>Parent<span style="color: #808030;">></span>
<span style="color: #808030;"><</span><span style="color: #808030;">/</span>Parents<span style="color: #808030;">></span>
</pre><div style="background: none repeat scroll 0% 0% rgb(255, 255, 255); color: black;"><b></b></div><div style="background: none repeat scroll 0% 0% rgb(255, 255, 255); color: black;"><br />
<br />
<b>Creating an xmlTree using XElement.Parse</b></div><b></b><br />
The above example is not the only way to create an xmlTree, XElement’s Parse method can be used to create an xmlTree from a string containing XML.<br />
<br />
XElement xmlTreeExample2 =<br />
<br />
new XElement.Parse(xmlString, LoadOptions.None);<br />
<br />
LoadOptions set to None will not preserve white spaces or retain line information. If this is required then set LoadOptions to LoadOptions.PreserveWhitespace or LoadOptions.SetLineInfo. Please note, using LoadOptions.SetLineInfo will mean taking a performance hit. <br />
<br />
<b>Creating an xmlTree using XElement.Load</b><br />
<br />
Using the code snippet above, the XElement object ‘xmlTreeExample2’ can be saved in an XML file.<br />
<br />
xmlTreeExample2.Save(“TestTree.xml”);<br />
<br />
The Load method allows an XElement to be loaded from an XML file.<br />
<br />
XElement xmlTreeExample3 = XElement.Load(“TestTree.xml”);<br />
<br />
The Load method can also be used to load an XElement from a TextReader, xmlReader and using a stream an XElement instance can be created. See the following link for more information on these alternative methods.<br />
<br />
<a href="http://msdn.microsoft.com/en-us/library/bb350413.aspx">http://msdn.microsoft.com/en-us/library/bb350413.aspx</a><br />
<br />
The following link provides more information on creating xmlTrees<br />
<br />
<a href="http://msdn.microsoft.com/en-us/library/bb387068%28v=VS.90%29.aspx">http://msdn.microsoft.com/en-us/library/bb387068(v=VS.90).aspx</a> <br />
<br />
<b>LINQ to XML</b> <br />
<b></b> <br />
LINQ to XML is an approach to programming XML in .NET using LINQ query expressions. Query results can be used as parameters in XElement and XAttribute objects when creating xmlTrees. This functionality(known as functional construction) allows xmlTrees to be transformed from one shape to another. <br />
<br />
<b>Simple LINQ to XML queries</b> <br />
<b></b> <br />
XElement xmlTreeExample4 contains the following XML:<br />
<br />
<span style="color: #808030;"><</span>Parents<span style="color: #808030;">></span><br />
<br />
<span style="color: #808030;"> <</span>Parent<span style="color: #808030;">></span><br />
<br />
<span style="color: #808030;"> <</span>ChildElement1<span style="color: #808030;">></span>ABCD<span style="color: #808030;"><</span><span style="color: #808030;">/</span>ChildElement1<span style="color: #808030;">></span><br />
<br />
<span style="color: #808030;"> <</span>ChildElement2<span style="color: #808030;">></span><br />
<br />
<span style="color: #808030;"> <</span>GrandChildElement1<span style="color: #808030;">></span><span style="color: #008c00;">1234</span><span style="color: #808030;"><</span><span style="color: #808030;">/</span>GrandChildElement1<span style="color: #808030;">></span><br />
<br />
<span style="color: #808030;"> <</span><span style="color: #808030;">/</span>ChildElement2<span style="color: #808030;">></span><br />
<br />
<span style="color: #808030;"> <</span><span style="color: #808030;">/</span>Parent<span style="color: #808030;">></span><br />
<br />
<span style="color: #808030;"> <</span>Parent<span style="color: #808030;">></span><br />
<br />
<span style="color: #808030;"> <</span>ChildElement1<span style="color: #808030;">></span>EFGH<span style="color: #808030;"><</span><span style="color: #808030;">/</span>ChildElement1<span style="color: #808030;">></span><br />
<br />
<span style="color: #808030;"> <</span>ChildElement2<span style="color: #808030;">></span><br />
<br />
<span style="color: #808030;"> <</span>GrandChildElement1<span style="color: #808030;">></span><span style="color: #008c00;">5678</span><span style="color: #808030;"><</span><span style="color: #808030;">/</span>GrandChildElement1<span style="color: #808030;">></span><br />
<br />
<span style="color: #808030;"> <</span><span style="color: #808030;">/</span>ChildElement2<span style="color: #808030;">></span><br />
<br />
<span style="color: #808030;"> <</span><span style="color: #808030;">/</span> Parent<span style="color: #808030;">></span> <br />
<br />
<span style="color: #808030;"><</span><span style="color: #808030;">/</span>Parents<span style="color: #808030;">></span><br />
<br />
<br />
The following code snippet shows how to retrieve the value of the element ChildElement1 from each parent element in xmlTreeExample4. <br />
<br />
IEnumerable<string> elementValue =<br />
<br />
from parent in xmlTreeExample4.Descendants(“Parent”) <br />
<br />
select (string) parent.Element(“ChildElement1”); <br />
<br />
The following code snippet shows how to retrieve the value of the element GrandChildElement1 from each parent element in the xmlTreeExample4. <br />
<br />
IEnumerable<int> elementValue =<br />
<br />
from parent in xmlTreeExample4.Descendants(“Parent”) <br />
<br />
select (int) parent.Element(“ChildElement2”).Element(“GrandChildElement1”); <br />
<br />
To retrieve the values of all descendants of each Parent element the following code shows how this can be achieved. <br />
<br />
var parentData = from parent in xmlTreeExample4.Descendants(“Parent”)<br />
<br />
select new<br />
<br />
{<br />
<br />
child = parent.Element(“ChildElement1”).Value,<br />
<br />
grandchild = parent.Element(“ChildElement2”).Element(“GrandChildElement1”).Value <br />
<br />
};<br />
<br />
A for each loop can be used to loop through each object in parentData, like so<br />
<br />
foreach (var parent in parentData)<br />
<br />
{<br />
//do some processing here<br />
}<br />
<br />
If each parent element in xmlTreeExample4 contained an attribute called ‘ParentName’, for example<br />
<br />
<br />
</int></string><br />
<pre style="background: none repeat scroll 0% 0% rgb(255, 255, 255); color: black;"><span style="color: #808030;"><</span>Parent ParentName<span style="color: #808030;">=</span>”FirstParent”<span style="color: #808030;">></span></pre><div style="background: none repeat scroll 0% 0% rgb(255, 255, 255); color: black;"></div><br />
<br />
To retrieve this ‘ParentName’ attribute value, the following can be done<br />
<br />
IEnumerable<string> attributeValue =<br />
<br />
from parent in xmlTreeExample4.Descendants(“Parent”)<br />
<br />
select (string) parent.Attribute("ParentName"); <br />
<br />
See the Microsoft site for more information on LINQ to XML <br />
<br />
<a href="http://msdn.microsoft.com/en-us/library/bb387098%28v=VS.90%29.aspx">http://msdn.microsoft.com/en-us/library/bb387098(v=VS.90).aspx</a><br />
<br />
For more information on Programming C# LINQ Query Expressions see this link<br />
<br />
<a href="http://msdn.microsoft.com/en-us/library/bb397676%28v=VS.90%29.aspx">http://msdn.microsoft.com/en-us/library/bb397676(v=VS.90).aspx</a></string>Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2675836407818906135.post-23776284933461105762011-02-03T09:25:00.000-08:002011-02-03T09:31:11.738-08:00Developing Rest Web Services using .NET WCFThere are a number of ways to create a rest web service in visual studio.<br />
<br />
1)Convert an existing WCF soap web service into a WCF rest web service.<br />
<br />
The following 15 minute video shows how easy it is to accomplish this.<br />
http://channel9.msdn.com/shows/Endpoint/endpointtv-Screencast-Building-RESTful-Services-with-WCF/<br />
<br />
2)Download Microsoft's WCF Rest Starter Kit from the following codeplex site:<br />
<br />
http://aspnet.codeplex.com/releases/view/24644<br />
<br />
A white paper on developing rest in WCF using the rest starter kit can be found here:<br />
<br />
http://msdn.microsoft.com/en-us/library/ee391967.aspx<br />
<br />
The starter kit contains various templates to speed up the process of creating services. The templates include an Atom Feed WCF Service, AtomPub WCF Service, HTTP Plain XML WCF Service, REST Collection WCF Service and a REST Singleton WCF Service.<br />
<br />
3)Create a WCF Rest web service from scratch using a visual studio solution containing for example the following projects:-<br />
<br />
<b>ASP.NET Web Application project template</b> - this project is used to create a rest service. It contains a service contract class with operation contracts and data contracts.<br />
<br />
A Web Service template is also added to this project, this template is a visually designed class for creating a web service. This is where the implementation code for the operation contracts of the web service will be placed.<br />
<br />
<b>Windows Forms Application project template</b> - used to host the rest web service. This project contains an app.config file and a code file with service host code.Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2675836407818906135.post-47484254606877232602011-01-22T10:50:00.001-08:002011-01-22T11:06:33.835-08:00Combining Cloud Computing, SOA and Web 2.0<div style="font-family: Georgia,"Times New Roman",serif;">Service Orientated Architecture (SOA) and Web 2.0 technologies can help organizations implement Cloud services in their IT environment.</div><br />
<div style="font-family: Georgia,"Times New Roman",serif;">The following diagram shows the layers of an emerging Enterprise Computing Stack.</div><div class="separator" style="clear: both; text-align: left;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8BQpRwkY_bT0Xv4LD1wqH17UtBEvpz_CIoU9-2w8PH9Ds5NPJ-nvp3JwsKpBrlgXXfVH7U7uxIL9VLAyI0zRNR_LFKHLL1BKSaVEBEThLBc_-TIPOuzROG1hjGmZiiw_7S4xSHNtPgvU/s1600/Cloud_SOA_Web2_0.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8BQpRwkY_bT0Xv4LD1wqH17UtBEvpz_CIoU9-2w8PH9Ds5NPJ-nvp3JwsKpBrlgXXfVH7U7uxIL9VLAyI0zRNR_LFKHLL1BKSaVEBEThLBc_-TIPOuzROG1hjGmZiiw_7S4xSHNtPgvU/s1600/Cloud_SOA_Web2_0.png" /></a></div><br />
<div style="font-family: Georgia,"Times New Roman",serif;">Web 2.0 allows for building user interfaces and collaboration. Within an organisation this technology is referred to as Enterprise Web 2.0, it can be delivered using enterprise portals such as Microsoft SharePoint, Oracle WebCenter Suite and IBM Websphere Portal.</div><br />
<div style="font-family: Georgia,"Times New Roman",serif;">SOA enables the building and integrating of applications improving business agility. SOA can be used to take advantage of Cloud services and present these resources to the users via Web 2.0 technologies such as AJAX, Mashups, RSS and enterprise social computing. SOA greatly reduces the risks when building Hybrid cloud environments by providing a more integrated on-premise and public cloud solution. SOA also makes it easier to move services between Cloud environments. If an organization doesn’t have an on-premise cloud, having an SOA environment helps to identify and integrate public cloud services into the existing environment.</div><br />
<div style="font-family: Georgia,"Times New Roman",serif;">The three Cloud computing layers shown in the diagram are:<br />
<b>Infrastructure as a Service (IaaS)</b> provides hardware and system software as a service including Storage, Compute and Networking. These services provide access to IT infrastructure components.<br />
<b>Platform as a Service (PaaS)</b> provides services for creating, deploying and managing applications<br />
<b>Software as a Service (SaaS)</b> is application software delivered as a service.</div><br />
<div style="font-family: Georgia,"Times New Roman",serif;">These Cloud layers can be implemented individually, they do not depend on one another. SOA principles can be applied when building the Cloud layers. SOA architectural principles for example can be used to build a service-oriented Infrastructure as a Service (IaaS) layer.</div>Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2675836407818906135.post-22843915732038148482010-10-21T04:29:00.000-07:002010-10-21T04:29:38.657-07:00Introduction to Microsoft Windows Azure Platform A good introduction to Windows Azure can be found at the following link<br />
<br />
<a href="http://msdn.microsoft.com/en-us/library/ff803364.aspx">http://msdn.microsoft.com/en-us/library/ff803364.aspx</a><br />
<br />
The Windows Azure SDK download (Sept 2010 UPDATE) is available here<br />
<br />
<a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=21910585-8693-4185-826E-E658535940AA">http://www.microsoft.com/downloads/en/details.aspx?FamilyID=21910585-8693-4185-826E-E658535940AA</a><br />
<br />
The SDK includes an off-line test environment called 'Developer Fabric', it is a simulation of Azure(Cloud Fabric), the subscription based production environment running in Microsoft's data centers. The SDK provides dev's with APIs, tools, docs and code samples to help develop app's on Win Azure.<br />
<br />
Also available to download is Win Azure Tools for MS Visual Studio(ver.1.2 June 2010)<br />
<br />
<a href="http://www.blogger.com/%20http://www.microsoft.com/downloads/en/details.aspx?FamilyID=2274a0a8-5d37-4eac-b50a-e197dc340f6f&displaylang=en#SystemRequirements">http://www.blogger.com/%20http://www.microsoft.com/downloads/en/details.aspx?FamilyID=2274a0a8-5d37-4eac-b50a-e197dc340f6f&displaylang=en#SystemRequirements</a><br />
<br />
This download includes Windows Azure SDK and can be used with VS2008 & VS2010. Dev's can create, configure, build, debug, run, package and deploy scalable web app's and services.<br />
<br />
There are some known issues/bugs in this SDK, some fixes can be found at<br />
<br />
<a href="http://code.msdn.microsoft.com/wcfazure/Wiki/View.aspx?title=KnownIssues">http://code.msdn.microsoft.com/wcfazure/Wiki/View.aspx?title=KnownIssues</a><br />
<br />
A Windows Azure training kit is available to download, it comes with hands-on labs, presentations and demos designed to help you learn how to use Win Azure, SQL Azure and AppFabric. The June 2010 release includes new and updated labs for VS2010.<br />
<br />
<a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=413E88F8-5966-4A83-B309-53B7B77EDF78&displayLang=en">http://www.microsoft.com/downloads/en/details.aspx?FamilyID=413E88F8-5966-4A83-B309-53B7B77EDF78&displayLang=en</a><br />
<br />
<b>Web Developer Portals</b><br />
<br />
There are 4 portals associated with Windows Azure platform, 3 are subscription based the other is free to use. A windows Live ID is required to sign-in to these portals, you can sign-up for a Live ID on any one of the portal sign-in pages.<br />
<br />
1)Windows Azure Web Dev Portal - Subscription required, app's and services are uploaded to the cloud and are accessable as hosted services. Can be found at <a href="http://windows.azure.com/">http://windows.azure.com/</a><br />
<br />
2)SQL Azure Web Portal - Subscription required, data stored in the cloud. Can be found at <a href="http://sql.azure.com/">http://sql.azure.com/</a><br />
<br />
3)Windows Azure AppFabric Web Dev Portal - Subscription required, use Service Bus and Access Control. Found at <a href="http://appfabric.azure.com/">http://appfabric.azure.com/</a><br />
<br />
4)Windows Azure AppFabric LABS Web Portal - FREE, test environment for developing against the AppFabric Service Bus. Found at <a href="https://portal.appfabriclabs.com/">https://portal.appfabriclabs.com/</a>Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2675836407818906135.post-65554702315729149132010-10-21T04:27:00.001-07:002010-10-21T04:27:42.899-07:00"How Do I?" Video Series for Windows Azure PlatformA series of short videos covering Windows Azure, Azure Service Bus and SQL Azure can be found at:<br />
<br />
<a href="http://msdn.microsoft.com/en-gb/windowsazure/ff798080.aspx">http://msdn.microsoft.com/en-gb/windowsazure/ff798080.aspx</a><br />
<br />
The videos duration ranges from 6 minutes to 75 minutes in length.<br />
<br />
For videos in this series covering Azure AppFabric -<br />
<br />
Get started with Azure Service Bus (24 minutes in length) covers signing up, creating projects, namespaces and service remoting via the service bus environment.<br />
<a href="http://msdn.microsoft.com/en-gb/windowsazure/ff181517.aspx">http://msdn.microsoft.com/en-gb/windowsazure/ff181517.aspx</a><br />
<br />
<br />
Get started with Access Control Services (26 mins) covers authentication and authorization of WCF web services in the cloud.<br />
<a href="http://msdn.microsoft.com/en-gb/windowsazure/ee943797.aspx">http://msdn.microsoft.com/en-gb/windowsazure/ee943797.aspx</a><br />
<br />
Create and use a service bus message buffer (22 mins) covers sending and receiving (simple text based and complex custom types) messages using a cloud message queuing system.<br />
<a href="http://msdn.microsoft.com/en-gb/windowsazure/ee943810.aspx">http://msdn.microsoft.com/en-gb/windowsazure/ee943810.aspx</a>Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2675836407818906135.post-67061966975106037962010-10-21T04:27:00.000-07:002010-10-21T04:27:09.105-07:00Windows Azure Platform On Demand WebcastsFor a list of recent webcasts covering Windows Azure Platform see the following link:<br />
<br />
<a href="http://www.microsoft.com/events/series/azure.aspx?tab=webcasts&id=odall">http://www.microsoft.com/events/series/azure.aspx?tab=webcasts&id=odall</a><br />
<br />
No signing in is required to watch these webcasts.<br />
<br />
Some Windows Azure AppFabric webcasts from the link above -<br />
<br />
<br />
<a href="http://www.microsoft.com/events/series/azure.aspx?tab=Webcasts&seriesid=155&webcastid=14140">Introduction to Windows Azure AppFabric (Level 200) 61 minutes, Aug 2010</a><br />
<br />
<br />
<a href="http://www.microsoft.com/events/series/azure.aspx?tab=Webcasts&seriesid=155&webcastid=14144">Developing for Windows Azure AppFabric Service Bus (Level 300) 53 minutes, Sept 2010</a><br />
<br />
<br />
<a href="http://www.microsoft.com/events/series/azure.aspx?tab=Webcasts&seriesid=155&webcastid=14141">Securing Web Resources Using Windows Azure AppFabric Access Control (Level 300) 55 minutes, Aug 2010</a><br />
<br />
<br />
<a href="http://www.microsoft.com/events/series/azure.aspx?tab=Webcasts&seriesid=155&webcastid=6403">Communication Patterns Supported by Windows Azure Platform AppFabric (Level 200) 60 minutes, Oct 2009</a>Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2675836407818906135.post-40287572962563301892010-10-21T04:26:00.000-07:002010-10-21T04:26:03.043-07:00Microsoft TechEd North America June 2010 VideosSharepoint and Azure (60 minutes)<br />
<a href="http://www.msteched.com/2010/NorthAmerica/OSP213">http://www.msteched.com/2010/NorthAmerica/OSP213</a><br />
<br />
Real World Patterns for Cloud Computing (68 minutes)- covers examples of cloud architectures<br />
<a href="http://www.msteched.com/2010/NorthAmerica/ARC304">http://www.msteched.com/2010/NorthAmerica/ARC304</a><br />
<br />
Securing the Cloud - Expert Panel (72 minutes)<br />
<a href="http://www.msteched.com/2010/NorthAmerica/SIA332">http://www.msteched.com/2010/NorthAmerica/SIA332</a><br />
<br />
Lap Around the Windows Azure Platform (75 minutes)<br />
<a href="http://www.msteched.com/2010/NorthAmerica/COS303">http://www.msteched.com/2010/NorthAmerica/COS303</a><br />
<br />
The Economics of Cloud Computing (67 minutes)- covers pricing model and SLA's<br />
<a href="http://www.msteched.com/2010/NorthAmerica/COS306">http://www.msteched.com/2010/NorthAmerica/COS306</a>Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2675836407818906135.post-22536346229992865732010-10-21T04:19:00.000-07:002010-10-21T04:50:24.968-07:00Getting Started with a Windows Azure AppFabric Labs Account using the Echo code sampleIn the following we will be using Echo Azure AppFabric SDK C# code sample, as our example application.<br />
<br />
The Echo code sample can be found in the AppFabricSamples\ServiceBus\Getting Started folder of the WinAzureAppFabricSDKSamplesV1C# download.<br />
<br />
Since these samples are intended to work using Windows Azure AppFabric Portal (subscription account) some configuration work is necessary in your environment and in the 'Access Control Service' section of your FREE Windows Azure AppFabric Labs Portal Account.<br />
<br />
Assuming you have signed up for a FREE Windows Azure AppFabric LABS Portal Account, you have created a project and a service namespace (see the How to create a Windows Azure Labs portal account blog entry on how to accomplish this).<br />
<br />
<br />
1) Windows Azure AppFabric SDK page, download SDK-x64 for 64bit OS or x86 for 32bit OS, SDK code samples and appfabric docs.<br />
<br />
<a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=39856a03-1490-4283-908f-c8bf0bfad8a5&displaylang=en">http://www.microsoft.com/downloads/en/details.aspx?FamilyID=39856a03-1490-4283-908f-c8bf0bfad8a5&displaylang=en</a><br />
<br />
Install appropriate SDK.<br />
<br />
2) Windows Azure AppFabric LABS SDK Aug 2010 download page which can be found here<br />
<br />
<a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=D89640FC-C552-446E-AEAD-B1E0D940F31B">http://www.microsoft.com/downloads/en/details.aspx?FamilyID=D89640FC-C552-446E-AEAD-B1E0D940F31B</a><br />
<br />
There is no SDK to download here since you already have the Windows Azure AppFabric SDK downloaded and installed. Download Release Notes and ServiceBus.config.txt files.<br />
<br />
RENAME ServiceBus.config.txt to ServiceBus.config<br />
<br />
Paste ServiceBus.config in the following dir (if you have 64bit)<br />
<br />
C:\Windows\Microsoft.Net\Framework64\v2.0.50727\CONFIG<br />
<br />
If you're using 32bit then replace Framework64 with your 32bit folder.<br />
<br />
3) Load the Echo code sample into VisualStudio. There are 2 projects in the solution both console app's, a WCF Service and a Client. Before you can run the app you need to create Issuer Credentials ie. an Issuer Name and Issuer Key(Issuer Secret). Later when you do run the app, run the service first, once its running start an instance of the Client, in the Client console you will be asked to enter some text to echo, the text you enter will then be echoed back by the Service.<br />
<br />
The Service takes your Issuer credentials passes them directly to AppFabric's ACS, then an endpoint is opened on the Service Bus in the Cloud. In order for the Client to access this Service Bus endpoint, it must have permission to communicate with it. The Client also takes your Issuer credentials, authenticates with AppFabric ACS Service in the Cloud, and aquires an access token that proves to the service bus infrastructure that the Client is authorized to access this endpoint. Once the client is connected you can type messages into Client console window and you will see messages echoed back by the running Service.<br />
<br />
4) Next create an Issuer Name and Issuer Secret (key). Sign in to your LABS Portal Account, select the project you created, then decide which Service Namespace you wish to use with this app. Click on the SERVICE BUS link of the service namespace you've chosen. The screen below is where you should be now, click orange Manage button to go to ACS Management Portal where you will create your new Issuer Credentials.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgU9Q-XFAO7_VWcINYcZPLdNW2ETpTrZK623bU0wXdkPChMmhIef7oXF_yiQylpCsFLme2ZJjRceVjKOjrlUe45Tg3CV_ULLO4p_qSkQNKSartC-Afn_woyC4hfmFPMHhKDSb4BYMmMnK4/s1600/EchoHowTo1.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="274" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgU9Q-XFAO7_VWcINYcZPLdNW2ETpTrZK623bU0wXdkPChMmhIef7oXF_yiQylpCsFLme2ZJjRceVjKOjrlUe45Tg3CV_ULLO4p_qSkQNKSartC-Afn_woyC4hfmFPMHhKDSb4BYMmMnK4/s640/EchoHowTo1.PNG" width="640" /></a></div><div class="separator" style="clear: both; text-align: center;"></div><br />
<br />
Access Control Service is the next screen you will see, select Identity Providers (Step 1), the Echo app uses a very simple straight forward approach for dealing with authorization and authentication. <br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3FPr6e6PktCz4Ci2b1r2Y_Sv0kboW2QEWk6_u_Bx2304KGwQX551qD2AS1NE0YpKpf4D6T_YgU3a56Fz8VnbSIPVbL0M2Q14ZFtkEI0qWnDfCu0bH8hOT8QLSlMWO5M7BpSeyHvBIc34/s1600/EchoHowTo2.PNG" imageanchor="1"><img border="0" height="362" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3FPr6e6PktCz4Ci2b1r2Y_Sv0kboW2QEWk6_u_Bx2304KGwQX551qD2AS1NE0YpKpf4D6T_YgU3a56Fz8VnbSIPVbL0M2Q14ZFtkEI0qWnDfCu0bH8hOT8QLSlMWO5M7BpSeyHvBIc34/s640/EchoHowTo2.PNG" width="640" /></a></div><br />
<br />
On the Identity Providers page select Service Identities<br />
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrd2NbMxcUmJ0en-mizJfwQVUkqyWv8zfPicgZYiN8BRDem_XSnQVU-i5GvDJJtNWMops21OIVMij_8alAK3hvDV-3beNDZ-iEaYYTERs-iwtw5WTehXyEudLLztjX1-uOQ0AZFTjMIAM/s1600/EchoHowTo3.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="348" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrd2NbMxcUmJ0en-mizJfwQVUkqyWv8zfPicgZYiN8BRDem_XSnQVU-i5GvDJJtNWMops21OIVMij_8alAK3hvDV-3beNDZ-iEaYYTERs-iwtw5WTehXyEudLLztjX1-uOQ0AZFTjMIAM/s640/EchoHowTo3.PNG" width="640" /></a></div><br />
<br />
On the Service Identities page, we will create an Issuer Name and Key. Select Add Service Identity.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhp7k0cAsvaGz5tBaGcZch8uPZNCDimc6f_J6MVdI40Wi-Ymx8RSzgkS8Z2zO1SfIdMK0NV-0cVJ31TrJWDWhRj4szQWL0CMcMN-KzUYkunncL2eKntyXVrOv8E8SpEDr9eHkH6Dx08_z4/s1600/EchoHowTo4.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="258" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhp7k0cAsvaGz5tBaGcZch8uPZNCDimc6f_J6MVdI40Wi-Ymx8RSzgkS8Z2zO1SfIdMK0NV-0cVJ31TrJWDWhRj4szQWL0CMcMN-KzUYkunncL2eKntyXVrOv8E8SpEDr9eHkH6Dx08_z4/s640/EchoHowTo4.PNG" width="640" /></a></div><br />
Enter owner as the Name, its the default name used by Microsoft, then press Save.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFxu3hhkx3sROjIkDDTcA0ukhNTKLpGGltmCTtfjYJs9WN29ueKOopoLGByR2v5FJcC8i8yXXWxLa0Lh5PH_DvzYiOj8NqEx2Fer4JUWKlAOph_JiOCwP-y0yqDdntHpj7e6HHP9IhvCM/s1600/EchoHowTo5.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="256" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFxu3hhkx3sROjIkDDTcA0ukhNTKLpGGltmCTtfjYJs9WN29ueKOopoLGByR2v5FJcC8i8yXXWxLa0Lh5PH_DvzYiOj8NqEx2Fer4JUWKlAOph_JiOCwP-y0yqDdntHpj7e6HHP9IhvCM/s640/EchoHowTo5.PNG" width="640" /></a></div>Next click Add Credential.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjra0sMUYshrFLlF8vPUVaDOzXsVMi2hviHhhVWBNohBQOMTHqnTM2d9FQnWwweFQazRRv45JCMs6IBjnbdD6CoygeewLy-vSj30gSGRM9MFlG9Ybu3kc5R8AE_ue0CoM_pFjiJI9Lf0PU/s1600/EchoHowTo6.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="258" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjra0sMUYshrFLlF8vPUVaDOzXsVMi2hviHhhVWBNohBQOMTHqnTM2d9FQnWwweFQazRRv45JCMs6IBjnbdD6CoygeewLy-vSj30gSGRM9MFlG9Ybu3kc5R8AE_ue0CoM_pFjiJI9Lf0PU/s640/EchoHowTo6.PNG" width="640" /></a></div><br />
On the Add Credential page enter owner as display name, for Type select Symmetric Key (this is your Issuer key/Issuer Secret). Press the Generate button to create key, then press Save button.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgY8qObtCtQBt407eFSXLGzMogusVynG_DbgN9XcRcwrOs4bS-RMbg50Lp-17pssKmvo2xRGdnwUCKLMWyugojrOX_z_p_3JP5cm46XnOeYA7MHxoNd8i3Y7bbGuHFZDenhdrbdhzuaxf0/s1600/EchoHowTo7.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="332" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgY8qObtCtQBt407eFSXLGzMogusVynG_DbgN9XcRcwrOs4bS-RMbg50Lp-17pssKmvo2xRGdnwUCKLMWyugojrOX_z_p_3JP5cm46XnOeYA7MHxoNd8i3Y7bbGuHFZDenhdrbdhzuaxf0/s640/EchoHowTo7.PNG" width="640" /></a></div><br />
You now have a new Issuer Name(owner) and Key. Under Credentials hover over your new Issuer(owner), the line will turn a blue colour, click on to blue line to see your full Issuer details, this takes you to the Edit Credential page.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigXXldMhYDbQOvSEN6Efv40MTozJWuEXGzPyPcjFk1arrPQP4jEBWE1fnBpraSZ9Iew_DoG1EazF5wsJ1ae2cUCmkwp043e_1_x6vii63W2yko3jkhrV5LIkv1uFDKztTaYxX3NX4tJ3A/s1600/EchoHowTo8.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="280" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigXXldMhYDbQOvSEN6Efv40MTozJWuEXGzPyPcjFk1arrPQP4jEBWE1fnBpraSZ9Iew_DoG1EazF5wsJ1ae2cUCmkwp043e_1_x6vii63W2yko3jkhrV5LIkv1uFDKztTaYxX3NX4tJ3A/s640/EchoHowTo8.PNG" width="640" /></a></div><br />
The Edit Credential page looks the same as the Add Credential page (see second image above). Click on the Service Identities link, it is just above the Edit Credential title near the top of this page. This will take you to the main Service Identities page which list all the Identities created including your new Issuer(owner) credential.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjC_3O5OlBI9FODRa7EXH3kXu-TWKtaROJmJuys0KKsoviVz382IWanM5y3WzIFr1bWNNXLafxB8VM4X8FcXkNT44h8YZySCF2X08MGcNtDKdI6sG5m5xosNzzKunk51NZwJngaCuPWpl8/s1600/EchoHowTo9.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="260" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjC_3O5OlBI9FODRa7EXH3kXu-TWKtaROJmJuys0KKsoviVz382IWanM5y3WzIFr1bWNNXLafxB8VM4X8FcXkNT44h8YZySCF2X08MGcNtDKdI6sG5m5xosNzzKunk51NZwJngaCuPWpl8/s640/EchoHowTo9.PNG" width="640" /></a></div>This completes step 4. Next we go back to Visual Studio and the Echo app example.<br />
<br />
<br />
5) In Visual Studio expand Client project, open Program.cs. Comment out the following code lines as shown below.<br />
<br />
/* Console.Write("Your Service Namespace: ");<br />
string serviceNamespace = Console.ReadLine();<br />
Console.Write("Your Issuer Name: ");<br />
string issuerName = Console.ReadLine();<br />
Console.Write("Your Issuer Secret: ");<br />
string issuerSecret = Console.ReadLine(); */<br />
<br />
<br />
Directly underneath add the following 3 lines of code. Enter your own service namespace (the one you created your Issuer Credentials under) and then enter your Issuer Key ( issuerSecret), this was generated for you. <br />
<br />
string serviceNamespace = " "; //add your service namespace here<br />
<br />
string issuerName = "owner";<br />
<br />
string issuerSecret = " "; //add your generated key here <br />
<br />
Make the above code changes in the Service project of your solution as well. Save changes and Build Solution.<br />
<br />
Press F5 to start, the Service Command Window will open, it may seem to be slow, but give the Service time to establish a connection to the Service Bus, things will run faster after initial connection is made. Once you see your service bus URL on the first line and press enter to exit appear on the second line, the Service is up and running.<br />
<br />
While the Echo service is running you can see it publicly listed from your LABS Portal Account. Go to the Service Bus section of your service namespace, under the Service Bus title click Registry URL (see first image under Step 4)). In the image below you can see an Echo Service listed, once you stop your Service running it will no longer appear there.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjU7x_7ze0Nd5gEAU9gcDdycKhU7I3xC9UFlRtjt1FDkjdPPYPFnhP5gjdkcvWaT6y_dzy0FRga7f6Z06mLBHIbxFl7MlGyTNi_GGmfvgnosHq15RVQV8krzsA0gOGuGCCQ0WP9SS7oTs4/s1600/EchoHowTo10.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="186" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjU7x_7ze0Nd5gEAU9gcDdycKhU7I3xC9UFlRtjt1FDkjdPPYPFnhP5gjdkcvWaT6y_dzy0FRga7f6Z06mLBHIbxFl7MlGyTNi_GGmfvgnosHq15RVQV8krzsA0gOGuGCCQ0WP9SS7oTs4/s640/EchoHowTo10.PNG" width="640" /></a></div>Run an instance of your Client, right click Client project name, select debug then select start new instance. Another command window will open, you will be asked to enter some text, when you do it will be echoed in the Service command window.<br />
<br />
The Echo code sample is a simple introduction to service remoting. A Client and a Service both hosted on-premise behind firewalls can communicate via a Cloud Service Bus Endpoint (URL).<br />
<br />
Creating Issuer credentials was an easy and straight forward way to ensure the Service (its Endpoint in the cloud) was only accessible by Clients with the correct credentials, preventing the possibility of just any Tom, Dick and Harry accessing the Service.<br />
<br />
That concludes this guide to getting started with Windows Azure AppFabric LABS Portal using the Echo code sample.Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2675836407818906135.post-14752944201950449622010-10-21T04:14:00.000-07:002010-10-21T04:51:14.014-07:00Creating a Windows Azure Appfabric Labs Account1) Go to Windows AppFabric Labs Portal Web page and sign into Portal using your Live ID (sign up for a Live ID Account if you dont already have one first, this can be done on the same page)<br />
<br />
<a href="https://portal.appfabriclabs.com/">https://portal.appfabriclabs.com/</a><br />
<br />
2) The first time you sign in you will be asked to create a Project. On the My Projects Page click <b>create a project</b> link. This takes you to the Sign Up page, enter a project name and click <b>OK</b>. You will then be taken to your new Project page, which lists your Project Id, subscription Id which will be 0 since the Labs Portal is FREE to use.<br />
<br />
3) Next create a service namespace under your new Project. You will need to create namespaces for your app's, more than one app can have the same namespace. Use Projects to group together common namespaces. On your Project page click <b>Add Service Namespace</b> link, it is on the bottom right of your project page.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDCyQsecjfvf5qZ5YhnPyozMHQitu6tTZ-ViF4bduhuRbgjQv2eWOBfordBVJid19d8BX3N8Q4lel8Q8IYVyas0w2qpKNMGeDOm7ULy-Tzz_haPSUkmVZKZibr05G9W2zx6Q70ccaMLj4/s1600/LabsSignIn1.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="283" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDCyQsecjfvf5qZ5YhnPyozMHQitu6tTZ-ViF4bduhuRbgjQv2eWOBfordBVJid19d8BX3N8Q4lel8Q8IYVyas0w2qpKNMGeDOm7ULy-Tzz_haPSUkmVZKZibr05G9W2zx6Q70ccaMLj4/s640/LabsSignIn1.PNG" width="640" /></a></div><br />
<br />
On the Create New Service Namespace page enter a name and then click <b>Validate Name</b>, your name has to be validated to ensure it is globally unique. In the <b>select a region</b> section you have only 1 choice - USA. Next Click <b>Create</b> to create the new namespace.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8WcD-S1owobXUeh6uicGg9kgNjovnAXBVQa3FpzMoqARlL8X83tsWXsYWS6dhQOLmATAHhXCAb4G1Kzw2j2Ufx4fiQ4xy1L-qS_JEVQEJF8z4DeolvW1DsLszjs4fr1TFg60bY2RApeY/s1600/LabsSignIn2.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="464" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8WcD-S1owobXUeh6uicGg9kgNjovnAXBVQa3FpzMoqARlL8X83tsWXsYWS6dhQOLmATAHhXCAb4G1Kzw2j2Ufx4fiQ4xy1L-qS_JEVQEJF8z4DeolvW1DsLszjs4fr1TFg60bY2RApeY/s640/LabsSignIn2.PNG" width="640" /></a></div><br />
You will then be taken back to <b>Your Project</b> page, at the bottom of this page you will see your new service namespace added to the project.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAln5dvw7rXkBIyq-9y_NpCF_JC9h1DxdpaG0p9P7UlfhKLwq1XQqe7U9duXEFoPfqP3cHDpOCdszPDe6xW6uSHnITTDQheccQ_Mwbu6hgXrnU1-OfOyNik0VBfr3-Lv8yL7U39kxBrgI/s1600/LabsSignIn3.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="302" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAln5dvw7rXkBIyq-9y_NpCF_JC9h1DxdpaG0p9P7UlfhKLwq1XQqe7U9duXEFoPfqP3cHDpOCdszPDe6xW6uSHnITTDQheccQ_Mwbu6hgXrnU1-OfOyNik0VBfr3-Lv8yL7U39kxBrgI/s640/LabsSignIn3.PNG" width="640" /></a></div><br />
In the next blog I will go through how to run the Echo code sample C# version , which can be found in the AppFabricSamples\ServiceBus\Getting Started folder of the WinAzureAppFabricSDKSamplesV1C# download. The samples are configured to run using Windows Azure AppFabric Web Portal (subscription accounts) and NOT for the FREE Windows AppFabric Labs Portal . In order to successfully run Echo, using the FREE Labs Portal, you'll need to do some configuration work in your own environment and in the Access Control Service section of your Windows AppFabric Labs Portal Account.Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2675836407818906135.post-24284720319587597402010-10-21T04:12:00.000-07:002010-10-21T04:22:02.288-07:00Windows Azure Access Control Service Samples and DocumentationThere is a September 2010 Labs release of Access Control Service ACS at the following link <a href="http://acs.codeplex.com/">http://acs.codeplex.com/</a> . This ACS samples and documentation project is intended to be used with an Azure AppFabric labs portal account. The above link takes you to the home page which lists the key features of ACS.<br />
<br />
There is a getting started section <a href="http://acs.codeplex.com/wikipage?title=Getting%20Started&referringTitle=Home">http://acs.codeplex.com/wikipage?title=Getting%20Started&referringTitle=Home</a> if you want to dive right in, starting with creating an ACS namespace, adding identity providers, setup relying party, create rules, define signing credentials and integrate with Visual Studio. <br />
<br />
Working with the Management Portal page <a href="http://acs.codeplex.com/wikipage?title=Working%20with%20the%20Management%20Portal&referringTitle=Documentation">http://acs.codeplex.com/wikipage?title=Working%20with%20the%20Management%20Portal&referringTitle=Documentation</a> , this documentation covers managing ACS configuration. Provides step by step instructions on how to work with the various ACS resources available in the management portal.<br />
<br />
A videos walkthrough page is available at <a href="http://acs.codeplex.com/wikipage?title=Videos&referringTitle=Home">http://acs.codeplex.com/wikipage?title=Videos&referringTitle=Home</a> .<br />
<br />
The download ACS samples page <a href="http://acs.codeplex.com/releases/view/53011">http://acs.codeplex.com/releases/view/53011</a> . The readme's for the samples <a href="http://acs.codeplex.com/wikipage?title=Samples">http://acs.codeplex.com/wikipage?title=Samples</a> .<br />
<br />
The prerequisites page can be found here <a href="http://acs.codeplex.com/wikipage?title=Prerequisites&referringTitle=Home">http://acs.codeplex.com/wikipage?title=Prerequisites&referringTitle=Home</a> , Visual Studio 2010 any edition, .NET4 or 3.5 SP1, WIF Runtime and SDK are among the requirements.Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2675836407818906135.post-57808778773808607032010-10-21T04:11:00.000-07:002010-10-21T04:22:24.011-07:00Windows Azure AppFabricFor an good introduction to Service Bus and Access Control check out the following link<br />
<br />
<a href="http://www.microsoft.com/windowsazure/appfabric/#appfablabs">http://www.microsoft.com/windowsazure/appfabric/#appfablabs</a><br />
<br />
Windows Azure AppFabric SDK (Sept 2010 UPDATE) download can be found at<br />
<br />
<a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=39856a03-1490-4283-908f-c8bf0bfad8a5&displaylang=en">http://www.microsoft.com/downloads/en/details.aspx?FamilyID=39856a03-1490-4283-908f-c8bf0bfad8a5&displaylang=en</a><br />
<br />
32bit and 64bit SDK versions are available. Also, code samples for VB & C# and AppFabricDocs. The docs download is blocked for security, so once you have downloaded the docs, right click the docs file, select properties, click unblock then click Apply and OK. The docs can be read offline.<br />
<br />
Windows Azure AppFabric Labs (Aug 2010 UPDATE) download can be found at<br />
<br />
<a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=D89640FC-C552-446E-AEAD-B1E0D940F31B">http://www.microsoft.com/downloads/en/details.aspx?FamilyID=D89640FC-C552-446E-AEAD-B1E0D940F31B</a><br />
<span id="goog_1231175212"></span><span id="goog_1231175213"></span><a href="http://www.blogger.com/"></a><br />
<span id="goog_1231175212">There are 2 files to download, the Service Bus.config.txt file and release notes(html) file. There is no SDK to download here, you need to download and install the win. Azure AppFabric SDK.</span><span id="goog_1231175213"></span><br />
<span id="goog_1231175212"></span><span id="goog_1231175213"></span><a href="http://www.blogger.com/"></a>Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2675836407818906135.post-73048285030837930152010-10-21T04:09:00.000-07:002010-10-21T04:09:15.887-07:00Windows Azure AppFabric ACM.EXE and ACMBrowserACM.exe is an Azure AppFabric Access Control Management Tool, it is a command line tool for performing management operations on Azure AppFabric Access Control resources that reside on Azure cloud. ACMBrowser is a WPF GUI version. <br />
<br />
When you need to create, update and delete Access Control resources these tools can be run on local machines, once you have made the necessary changes, the changes can be saved to the cloud. Both tools communicate with the Access Control Management Service in Azure, saving you from having to sign in to your portal account everytime.<br />
<br />
Currently these tools do not work if you have an Azure AppFabric Labs Portal Account, they are intended for Azure AppFabric Portal Account holders. <br />
<br />
The Acm.exe tool can be found in the Azure AppFabric SDK download in the \Tools folder.<br />
<br />
Before you can utilize this tool you need to add a management key (can be found on the service namespace page), and the service namespace you are using, to the Acm.exe.config file. The Acm.exe.config file can be found in the \Tools folder of the Win Azure AppFabric SDK download.<br />
<br />
When you open the Acm.exe.config file, it contains the following- <br />
<br />
<code><br />
<?xml version="1.0" encoding="utf-8" ?><br />
<br />
<configuration><br />
<br />
<appSettings><br />
<br />
<add key="host" value="accesscontrol.windows.net"/><br />
<br />
<add key="service" value=""/><br />
<br />
<add key="mgmtkey" value=""/><br />
<br />
</appSettings><br />
<br />
</configuration> </code><br />
<br />
Creating an Access Control resource such as an Issuer using the Acm.exe tool, open a command window, change directory to the ProgramFiles\...AppFabric SDK\V1.0\Tools. <br />
<br />
To create an Issuer credential called owner, enter the following:<br />
<br />
acm create issuer -name:owner<enter a="" display="" name=""> -issuername:<eg. owner="">(enter a display name here) -autogeneratekey<br />
<br />
If all goes well an ID and the object was created successfully will be displayed.<br />
<br />
The GUI Tool ACMBrowser can be found in your AppFabricSamplesSDK download, go to the following directory<br />
<br />
AppFabricSamples\AccessControl\ExploringFeatures\Management\AcmBrowser<br />
<br />
Build and run AcmBrowser solution in Visual Studio.<br />
</eg.></enter>Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2675836407818906135.post-83333475491278732822010-10-20T12:12:00.000-07:002010-10-21T04:25:30.387-07:00Microsoft TechEd Australia Aug 2010 Videos<span lang="">Sessions are now available to view online.<br />
<br />
Win Azure Platform AppFabric Overview (74 mins)<br />
<a href="http://www.msteched.com/2010/Australia/COS230"><u><span style="color: blue;"><span lang="">http://www.msteched.com/2010/Australia/COS230</span></span></u></a></span><br />
<br />
<span lang="">The Business of Cloud Computing (76 mins)- cloud based PaaS and SaaS</span><br />
<span lang=""><a href="http://www.msteched.com/2010/Australia/ARC206"><u><span style="color: blue;"><span lang="">http://www.msteched.com/2010/Australia/ARC206</span></span></u></a><br />
<br />
<span lang="">Cloud Secret Sauce and what you can cook with it (72 mins)</span></span><br />
<span lang=""><span lang=""><a href="http://www.msteched.com/2010/Australia/ARC203"><u><span style="color: blue;"><span lang="">http://www.msteched.com/2010/Australia/ARC203</span></span></u></a></span></span><br />
<span lang=""><span lang=""><br />
<span lang="">Azure in the Real World Concept to Cloud (62mins) - what makes a good cloud app<br />
<span lang=""><span lang=""><span lang=""><a href="http://www.msteched.com/2010/Australia/VOC206"><u><span style="color: blue;"><span lang="">http://www.msteched.com/2010/Australia/VOC206</span></span></u></a></span></span></span></span></span></span><br />
<br />
<span lang="">Cloud Oriented Architecture in a retail business scenario (60 mins) - how to leverage azure appfabric service bus to connect together different areas of a retail business</span><br />
<span lang=""><a href="http://www.msteched.com/2010/Australia/ARC205"><u><span style="color: blue;"><span lang="">http://www.msteched.com/2010/Australia/ARC205</span></span></u></a></span><br />
<br />
<span lang="">Win Server AppFabric:Simplifiying the life of WCF WF Dev's (65 mins) - build config free WCF services using .Net, config and manage services using AppFabric Hosting Services</span><br />
<span lang=""><a href="http://www.msteched.com/2010/Australia/DEV322"><u><span style="color: blue;"><span lang="">http://www.msteched.com/2010/Australia/DEV322</span></span></u></a><br />
<br />
<span lang="">How do you secure cloud? (70 mins) - demistifying cloud security</span></span><br />
<a href="http://www.msteched.com/2010/Australia/SEC308"><u><span style="color: blue;"><span lang="">http://www.msteched.com/2010/Australia/SEC308</span></span></u></a>Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2675836407818906135.post-9234281568310934752010-10-20T12:02:00.000-07:002010-10-20T12:02:41.970-07:00WCF, HTTP Server API, Namespace Reservations and Access Control ListHttp server API or Http.sys is a kernel mode http driver with port sharing capabilities which means more than one application can listen on the same port.<br />
<br />
Http server API enables applications to communicate over http, applications can register to receive http requests for specified URL's and send http responses. An application not hosted in IIS and in a non-administrator account cannot bind to the http namespace at run time without an administrator reserving the namespace. This is a requirement of http.sys.<br />
<br />
A http namespace reservation allocates a part of the URL namespace to a user (or users), allowing the user to own that part of the namespace. An administrator can make this reservation for a specified URL on behalf of a user and their application. The application is then registered to receive and serve incoming service requests for the URL namespace . <br />
<br />
The http server API does not allow users to register URL's from parts of the namespace they do not own. For namespace security ACL's (access control list) are applied to the part of the namespace reserved for each user.<br />
<br />
Netsh.exe tool is used when manually configuring WCF using http/s. In windows 7 from an administrator account, to give a WCF web service called httpEchoService access rights to the namespace, launch a command window and enter the following<br />
<br />
<code><br />
netsh http add urlacl url=http://+:80/httpEchoService/ user=<your local machine name></code><br />
<br />
A reservation has now been made for the specified URL, this allows the application to bind to the http namespace at run time. <br />
<br />
A hierarchical structure is used with namespace reservations. If the following namespace 'http://anyname.com:80/' is reserved, so are all the subnamespaces, for eg. <br />
'http://anyname.com:80/app1' is a reserved subnamespace.<br />
<br />
When using Microsoft Visual Studio, to enable users without administrator privileges to develop WCF web services, an ACL is created for the following namespace http://+:8731/Design_Time_Addresses during installation of Visual Studio.<br />
<br />
Administrators can add/remove users from this ACL, or open additional ports. This ACL allows users access to the WCF service auto host (wcfsvchost.exe) without granting them administrator privileges. <br />
<br />
For more information on OS's, tools and commands see this link<br />
<a href="http://msdn.microsoft.com/en-us/library/ms733768.aspx">http://msdn.microsoft.com/en-us/library/ms733768.aspx</a><br />
<br />
More information on namespace reservations can be found at <br />
<a href="http://msdn.microsoft.com/en-us/library/aa364673%28VS.85%29.aspx%20">http://msdn.microsoft.com/en-us/library/aa364673%28VS.85%29.aspx%20</a>Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2675836407818906135.post-76317310743609478572010-10-13T15:24:00.000-07:002010-10-21T04:23:09.576-07:00Free Windows Azure Platform BookWindows Azure Platform: Articles from the trenches vol.1 was written by 15 developers sharing their experiences of the platform, combining 20 articles ranging from getting started to best practices. The book can be viewed on-line at:<br />
<br />
<a href="http://www.slideshare.net/ericnelson/windows-azure-platform-articles-from-the-trenches-volume-one">http://www.slideshare.net/ericnelson/windows-azure-platform-articles-from-the-trenches-volume-one</a><br />
<br />
or can be purchased as a paperback. <br />
<br />
Chapter 1: Getting started with Win Azure covers creating an account, creating, packaging and deploying an application plus best tools to use.<br />
<br />
Chapter 2: Architecting for Azure covers principles, cost, risk, development and test environment and running java code on Windows Azure.<br />
<br />
Chapter 3: Windows Azure covers scaling, blob storage, queries and tables, worker roles, logging and health monitoring and roles.<br />
<br />
Chapter 4: SQL Azure goes through process of creating an account, using sql portal and creating a DB.<br />
<br />
Chapter 5: Windows Azure Platform AppFabric covers real time tracing of Azure roles.Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2675836407818906135.post-19588016104567535982010-10-13T15:12:00.000-07:002010-10-13T15:17:46.538-07:00Fiddler 2, WCF and .NETIf you are developing WCF web services using ASP.NET Development Server (runs asp.net app's locally) and you are using localhost, Fiddler will not be able to monitor any request/response traffic. Fiddler is bypassed if localhost is used.<br />
<br />
<b>Fiddler and Firefox</b><br />
<br />
In Windows XP using .NET 3.5 VS2008 running a WCF REST web service (created in an ASP.NET Web App Project) you only need to replace localhost with your local machine name (a.k.a computer name), and Fiddler will monitor any requests to this service and the resulting response. Machine name can be found by right clicking 'My Computer' then selecting properties. Replacing localhost with your machine name only needs to be done on the client side (Firefox browser in this case). With an address like this<br />
<br />
<div style="color: blue;">http://localhost:1355/MyService.svc/</div><br />
replace localhost with your local machine name<br />
<br />
<span style="color: blue;">http://machinename:1355/MyService.svc/</span> <br />
<br />
Fiddler will now display request/response information.<br />
<br />
<b>Fiddler and Internet Explorer</b><br />
<br />
In Windows 7 running the same service mentioned above Fiddler can be used to monitor traffic by adding '.' (a full stop) to the end of localhost in your IE url, for eg<br />
<br />
<span style="color: blue;">http://localhost.:1355/MyService.svc/</span><br />
<br />
Fiddler will not be bypassed and requests made using IE will be picked up together with any resulting responses.<br />
<br />
<b>Just Fiddler</b><br />
<br />
In addition to using Firefox or IE as a webclient you can also use Fiddler, click the RequestBuilder tab to enter urls. Enter a url in the textbox beneath the request builder tab.<br />
<br />
The url you enter will appear in the left window. <br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzV-G-5o3H_6u1WMPvNndweNzZYECZ9L77cZqHhRwHJJCYEIFn5TqVeJ409DB8-szvbBzm1SMCMHBLfmoPzhej1Zi-94Za4XL_RALz_yXe8H6fDEmvjEr0DeQ-kqjFrnPfYVng1qBkzqQ/s1600/Fiddler+2+WCF+and+.NET1.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="260" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzV-G-5o3H_6u1WMPvNndweNzZYECZ9L77cZqHhRwHJJCYEIFn5TqVeJ409DB8-szvbBzm1SMCMHBLfmoPzhej1Zi-94Za4XL_RALz_yXe8H6fDEmvjEr0DeQ-kqjFrnPfYVng1qBkzqQ/s640/Fiddler+2+WCF+and+.NET1.PNG" width="640" /></a></div><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPpeV7gIi-X1Z0J6sXpFQHENl-769V7lSkq2gt5VUPY85rwebTi12VxEdZGfS0qdY1f-oUeYUOba04mHO_wi2ef1cHHwuSd1KyEzgioOSNxckNiESL7Jwlbw__LCQ8ztpwpbF8AFzpVfw/s1600/Fiddler+2+WCF+and+.NET2.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><br />
</a></div>Once you click on the matching url in the left window, it will be highlighted blue. Select the Inspectors tab from the menu of the top right window. The top right window displays request information, the bottom right window displays responses sent back by the service. Select the Textview tab from the menu in the bottom right window, the web service response will be displayed.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibdTh3I3cns5yMeV8nfnobHLPttLpPNqcr-TMBu92scumNqpic3zvE8OFpckFlN5Gc7nGsITQM9FnY8SqoxDCzCbCcfEGzvta6K1QSrJZ418m1g8WgVVJs1kgR-pwdIYCdHzmNQiImzW4/s1600/Fiddler+2+WCF+and+.NET2.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibdTh3I3cns5yMeV8nfnobHLPttLpPNqcr-TMBu92scumNqpic3zvE8OFpckFlN5Gc7nGsITQM9FnY8SqoxDCzCbCcfEGzvta6K1QSrJZ418m1g8WgVVJs1kgR-pwdIYCdHzmNQiImzW4/s640/Fiddler+2+WCF+and+.NET2.PNG" width="640" /></a></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhuykQ7gtyfClC7sqo7d-HhkIFgiO7x17sQbsfXcObztZQspgGA6l3CZ964mDTDXW4TrmcDkp0GScjcffIddKAbgKTNODKu9zMUQEM-k8zle0HJdifQDWht5lRJDb7jfGC9CHI5nGNDlU/s1600/Fiddler+2+WCF+and+.NET3.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><br />
</a></div><br />
To make a post method request to a REST web service using Fiddler, enter the url then select Post method from drop down list.<br />
<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhuykQ7gtyfClC7sqo7d-HhkIFgiO7x17sQbsfXcObztZQspgGA6l3CZ964mDTDXW4TrmcDkp0GScjcffIddKAbgKTNODKu9zMUQEM-k8zle0HJdifQDWht5lRJDb7jfGC9CHI5nGNDlU/s1600/Fiddler+2+WCF+and+.NET3.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="460" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhuykQ7gtyfClC7sqo7d-HhkIFgiO7x17sQbsfXcObztZQspgGA6l3CZ964mDTDXW4TrmcDkp0GScjcffIddKAbgKTNODKu9zMUQEM-k8zle0HJdifQDWht5lRJDb7jfGC9CHI5nGNDlU/s640/Fiddler+2+WCF+and+.NET3.PNG" width="640" /></a><br />
<br />
In the Request Body window enter the values of your complex type object.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh61sviDdY1y0OjO-V2wMcPyXVElHxMoRqX057ZMVSyQHKxBat46xgWZrtwiiveKyb1HIGTUYbC-Ppr9eYyzIffeCPCVsq4q77BXdJfWFOve7-LUS3GBS6nj7CWtlp7gxCiic3nlXfXINw/s1600/Fiddler+2+WCF+and+.NET4.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="452" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh61sviDdY1y0OjO-V2wMcPyXVElHxMoRqX057ZMVSyQHKxBat46xgWZrtwiiveKyb1HIGTUYbC-Ppr9eYyzIffeCPCVsq4q77BXdJfWFOve7-LUS3GBS6nj7CWtlp7gxCiic3nlXfXINw/s640/Fiddler+2+WCF+and+.NET4.PNG" width="640" /></a></div>Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2675836407818906135.post-3513244972008623442010-08-05T15:51:00.001-07:002010-08-09T15:02:24.193-07:00What is a WSDL documentA Web Services Description Language (WSDL) contains detailed information about how to access a Web Service. A WSDL contains information such as the operations, parameters and return values. The contents of WSDL are in XML format.<br />
<br />
More information on WSDL is found at the following resources.<br />
WSDL 1.1 specification: <a href="http://www.w3.org/TR/wsdl">http://www.w3.org/TR/wsdl</a><br />
WSDL 2.0 specification: <a href="http://www.w3.org/TR/wsdl20">http://www.w3.org/TR/wsdl20</a><br />
WSDL 2.0 primer: <a href="http://www.w3.org/TR/wsdl20-primer">http://www.w3.org/TR/wsdl20-primer</a><br />
<br />
<br />
<span style="font-size: large;"><b>WSDL Elements</b></span><br />
WSDL document contains the following main elements:<br />
<br />
<b>Definitions</b><br />
This is the root element of the WSDL document. This contains a set of namespace declarations i.e. xmlns:prefix attributes. Each namespace prefix is bound to a URI. The <i>name</i> attribute names this WSDL document as AmazonSearch shown below. The <i>targetNamespace</i> attribute is similar to an XML Schema definition’s targetNamespace. The names declared within this WSDL document are in the http://soap.amazon.com namespace.<br />
A WSDL from Amazon contains the following attributes.<br />
<code><br />
<wsdl:definitions xmlns:typens="http://soap.amazon.com"<br />
xmlns:xsd="http://www.w3.org/2001/XMLSchema"<br />
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"<br />
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"<br />
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"<br />
xmlns="http://schemas.xmlsoap.org/wsdl/"<br />
targetNamespace="http://soap.amazon.com"<br />
name="AmazonSearch"><br />
</code><br />
<br />
<b>Types</b><br />
Data types used by the service are described by XML Schema.<br />
An example:<br />
<code><br />
<wsdl:types><br />
<schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema"<br />
targetNamespace="http://MyCompany/MyProductService"><br />
<element name=”ProductName” " type="s:string" /><br />
<element name="Quantity" type="s:int" /><br />
</schema><br />
<wsdl:types><br />
</code><br />
<br />
A more complex example from Amazon:<br />
<code><br />
<wsdl:types><br />
<xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema"<br />
targetNamespace="http://soap.amazon.com"><br />
<xsd:complexType name="KeywordRequest"><br />
<xsd:all><br />
<xsd:element name="keyword" type="xsd:string"/><br />
<xsd:element name="page" type="xsd:string"/><br />
<xsd:element name="mode" type="xsd:string"/><br />
<xsd:element name="tag" type="xsd:string"/><br />
<xsd:element name="type" type="xsd:string"/><br />
<xsd:element name="devtag" type="xsd:string"/><br />
<xsd:element name="sort" type="xsd:string" minOccurs="0"/><br />
<xsd:element name="variations" type="xsd:string" minOccurs="0"/><br />
<xsd:element name="locale" type="xsd:string" minOccurs="0"/><br />
</xsd:all><br />
</xsd:complexType><br />
<xsd:complexType name="ProductInfo"><br />
<xsd:all><br />
<xsd:element name="TotalResults" type="xsd:string" minOccurs="0"/><br />
<!-- Total number of Search Results --><br />
<xsd:element name="TotalPages" type="xsd:string" minOccurs="0"/><br />
<!-- Total number of Pages of Search Results --><br />
<xsd:element name="ListName" type="xsd:string" minOccurs="0"/><br />
<!-- Listmania list name --><br />
<xsd:element name="Details" type="typens:DetailsArray" minOccurs="0"/><br />
</xsd:all><br />
</xsd:complexType><br />
</xsd:schema><br />
</wsdl:types><br />
</code><br />
<br />
<b>Message</b> <br />
Defines input parameters and result of a service operation. The <i>part</i> element refers to a data type.<br />
<code><br />
<message name="KeywordSearchRequest"><br />
<part name="KeywordSearchRequest" type="typens:KeywordRequest"/><br />
</message><br />
<message name="KeywordSearchResponse"><br />
<part name="return" type="typens:ProductInfo"/><br />
</message><br />
</code><br />
<br />
<b>Port Type</b><br />
Defines the operations and messages used.<br />
<code><br />
<portType name="AmazonSearchPort"><br />
<operation name="KeywordSearchRequest"><br />
<input message="typens:KeywordSearchRequest"/><br />
<output message="typens:KeywordSearchResponse"/><br />
</operation><br />
</portType><br />
</code><br />
<br />
<b>Binding</b><br />
Protocols used and message format is defined by the binding.<br />
Note the attribute type is the portType. The name attribute must be unique.<br />
<code><br />
<binding name="AmazonSearchBinding" type="typens:AmazonSearchPort"><br />
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/><br />
<!-- Binding for Amazon Web APIs - RPC, SOAP over HTTP --><br />
<operation name="KeywordSearchRequest"><br />
<soap:operation soapAction="http://soap.amazon.com"/><br />
<input><br />
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://soap.amazon.com"/><br />
</input><br />
<output><br />
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://soap.amazon.com"/><br />
</output><br />
</operation><br />
</binding><br />
</code><br />
<br />
<b>Service</b><br />
Groups a set of related port elements (endpoints), each specifying a binding with a corresponding address.<br />
The following specifies Amazon’s AmazonSearchService located at the URL address http://soap.amazon.com/onca/soap2.<br />
<code><br />
<service name="AmazonSearchService"><br />
<!-- Endpoint for Amazon Web APIs --><br />
<port name="AmazonSearchPort" binding="typens:AmazonSearchBinding"><br />
<soap:address location="http://soap.amazon.com/onca/soap2"/><br />
</port><br />
</service><br />
</code><br />
<br />
<b>Operation</b><br />
Operation describes a service action. Two main sections in a WSDL document containing operation information.<br />
PortType section:<br />
<code><br />
<operation name="KeywordSearchRequest"><br />
<input message="typens:KeywordSearchRequest"/><br />
<output message="typens:KeywordSearchResponse"/><br />
</operation><br />
</code><br />
<br />
Binding section:<br />
<code><br />
<operation name="KeywordSearchRequest"><br />
<soap:operation soapAction="http://soap.amazon.com"/><br />
<input><br />
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://soap.amazon.com"/><br />
</input><br />
<output><br />
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://soap.amazon.com"/><br />
</output><br />
</operation><br />
</code><br />
<br />
<b>Port</b><br />
Port specifies an endpoint at a particular address for a binding. Only one address can be specified.<br />
<code><br />
<!-- Endpoint for Amazon Web APIs --><br />
<port name="AmazonSearchPort" binding="typens:AmazonSearchBinding"><br />
<soap:address location="http://soap.amazon.com/onca/soap2"/><br />
</port><br />
</code><br />
<br />
<span style="font-size: large;"><b>WSDL Structure</b></span><br />
The following defines how the above elements fit together to form a WSDL 1.1 structure.<br />
<code><br />
<definitions><br />
<types> </types><br />
<message><br />
<part> </part><br />
</message><br />
<portType><br />
<operation><br />
<input> </input><br />
<output> </output><br />
<fault> </fault><br />
</operation><br />
</portType><br />
<binding><br />
<operation> </operation><br />
</binding><br />
<service><br />
<port> </port><br />
</service><br />
<definitions><br />
</code>Unknownnoreply@blogger.com