Patrick’s Bytes

Passing large files over WCF channel

Posted in WCF by patrickyong on July 2nd, 2008

If you want to pass large binary files via a WCF channel, you need to increase the maxStringContentLength on your WCF host app.config/web.config file. From my sample on my IssueTracker project, I added a new bindings element to the system.serviceModel section as below:
        <bindings>
            <wsHttpBinding>
                <binding name=”WSHttpBinding_IDataService” closeTimeout=”00:01:00″
                    openTimeout=”00:01:00″ receiveTimeout=”00:10:00″ sendTimeout=”00:01:00″
                    bypassProxyOnLocal=”false” transactionFlow=”false” hostNameComparisonMode=”StrongWildcard”
                    maxBufferPoolSize=”2147483647″ maxReceivedMessageSize=”2147483647″
                    messageEncoding=”Text” textEncoding=”utf-8″ useDefaultWebProxy=”true”
                    allowCookies=”false”>
                    <readerQuotas maxDepth=”2147483647″ maxStringContentLength=”2147483647″ maxArrayLength=”2147483647″
                        maxBytesPerRead=”2147483647″ maxNameTableCharCount=”2147483647″ />
                    <reliableSession ordered=”true” inactivityTimeout=”00:10:00″
                        enabled=”false” />
                    <security mode=”Message”>
                        <transport clientCredentialType=”Windows” proxyCredentialType=”None”
                            realm=”" />
                        <message clientCredentialType=”Windows” negotiateServiceCredential=”true”
                            algorithmSuite=”Default” establishSecurityContext=”true” />
                    </security>
                </binding>
            </wsHttpBinding>
        </bindings>

        Having done that, your service will still not using this binding configuration, you need to add the binding name to the bindingConfiguration attribute inside your service element.

  <services>
      <service behaviorConfiguration=”DataServiceBehavior” name=”Zuko.Service.DataService”>
        <endpoint address=”" binding=”wsHttpBinding” contract=”Zuko.Service.IDataService” bindingConfiguration=”WSHttpBinding_IDataService”>
          <identity>
            <dns value=”localhost” />
          </identity>
        </endpoint>
        <endpoint address=”mex” binding=”mexHttpBinding” contract=”IMetadataExchange” />
      </service>
    </services>

Microsoft Open Specification v1.0 released

Posted in .NET Programming, Exchange, Office, SQL Server, Sharepoint, WCF, WPF by patrickyong on July 1st, 2008

Awhile ago I blogged about Microsoft releasing products protocol documentation which are essential design specifications. That was about 2 months ago and the documents are of beta version.

Today the official version 1 is out that it covers the following products.

  1. Windows
  2. WCF
  3. Windows Server Protocol
  4. .NET Framework
  5. Office
  6. Office Binary File Format
  7. SharePoint
  8. Exchange
  9. SQL Server
  10. VBA Language Spec
  11. XAML

WCF Unit Test timeout issue

Posted in WCF by patrickyong on July 1st, 2008

image

I am creating some Unit Test for my IssueTracker project. My unit test class will connect to a WCF service and execute command. Whenever I start testing the code, after awhile the test just hang there until timeout and returns the follow message.

Failed    TestAddIssueAttachment    IssueTrackerTest    Assert.Fail failed. The request channel timed out while waiting for a reply after 00:01:00. Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding. The time allotted to this operation may have been a portion of a longer timeout.   

I am suspecting something is not right with my code. So I start searching the web, and I came across the following post by fellow MVP Benjamin Day. He had the same issue and realized actually he forgot to close the proxy connection. Yup, WCF proxy has to be closed, refer the unit test code sample below

                        [TestMethod]
        public void TestDeleteIssueAttachment()
        {
            IssueTrackerService.IssueTrackerServiceClient client
                = new IssueTrackerService.IssueTrackerServiceClient();

            try
            {

                client.Open();

                list = client.ListIssueAttachments().ToList();

                …..

            } finally {

                 client.Close();

            }

         }

Touch UI laptops in CSI NY: You Only Die Once

Posted in CSI NY, Windows 7 by patrickyong on June 29th, 2008

Just finish watching CSI New York tonight. Tonight’s episode (titled You one die once) featured a team of robbers with high tech James Bond gears like a self healing + laser cutter sport cars and tuxedoes wired with wireless connection to steal data from nearby digital devices. But the CSI NY squad themselves are also armed with some high tech stuff (I think CSI NY is the most geeky one among 3 with showcase of gadgets suited for si-fi) like a touch UI based laptop that works like iPhone of the recently showcased Windows 7. It is pretty cool seeing Mac Taylor carry one around his office and information is just at the touch of his finger tips.

csinyyouonlydieonce003qy6
Mac Taylor holding a Touch UI laptop


YouTube - Windows 7 seven First Official Video

Website to visit: 2advanced studios

Posted in Misc by patrickyong on June 28th, 2008

image

The art work of this website is just too damn cool to ignore. The loading page (because it is running on Flash) looks like a Command & Conquer game loading screen. And not to mention the theme music of the website rocks (yea… they got theme music some more)

Speaking of Command & Conquer, 2advanced Studios actually did the mini/ teaser site for Tiberium Sun game and also Star War’s The Force Unleashed.

Currently they put version 5.0 for this website, so I guess it went thru a few make over. Go here and pay a visit. Enjoy your weekend. :) http://www.2advanced.com/

Windows Server 2008 Hyper-V RTM!!

Posted in Hyper-V, Windows Server 2008 by patrickyong on June 27th, 2008

After months of testing, Hyper-V reached RTM status today. What is Hyper-V? Below is the explanation from Microsoft’s website.

Windows Server 2008 Hyper-V, the next-generation hypervisor-based server virtualization technology, allows you to make the best use of your server hardware investments by consolidating multiple server roles as separate virtual machines (VMs) running on a single physical machine. With Hyper-V, you can also efficiently run multiple different operating systems—Windows, Linux, and others—in parallel, on a single server, and fully leverage the power of x64 computing.

You can download it here. I will do the same and test it out over the weekend. :)

IssueTracker 3.5 started on Codeplex

Posted in .NET Programming, S+S by patrickyong on June 26th, 2008

Base on the idea behind the Issue Tracker project in www.asp.net, I am developing a new version with the intention of

  1. To help people to sump start .NET 3.5 development
  2. To help people to jump start an application based on the S+S vision
  3. To serve as a base of the future Start.NET course I plan to write

I got the help of Poh Sze and Ervin to help me on part of the project and I hope to showcase it in Tech.Ed SEA 2008.

Beware of msg/ sites requesting your Hotmail/Messenger password

Posted in Misc by patrickyong on June 25th, 2008

Please be aware of a malicious email circulating around the web that claims to be able to see who has blocked or deleted you from Windows Live Messenger. This is a hoax email which redirects you to a site when you click on the link in the email. The site then requests your Hotmail/Messenger password or Windows Live ID and starts spamming everyone on your contact list with this hoax.

Some of these sites even automatically infect your computer with a Trojan/Virus that steals all passwords on your computer. Below is an example of how the email looks like, these change over time so please be aware of suspicious emails such as this.

clip_image001

Paparazzi @Microsoft

Posted in Misc by patrickyong on June 24th, 2008

Found out about this microspoting blog by someone at MSFT campus who

creep around campus talking to my favorite kinds of people: geeks who are passionate about what they do.

Interesting gig she has there, it looks like a Web 2.0 journalist or something like that. But the site has some cool stuffs about life at MST Corp with blogs, photos and videos.

Wonder will she comes to Tech.Ed SEA…

I can read this, can you?

Posted in Misc by patrickyong on June 24th, 2008

fi yuo cna raed tihs, yuo hvae a sgtrane mnid too.
Cna yuo raed tihs? Olny 55 plepoe can.
i cdnuolt blveiee taht I cluod aulaclty uesdnatnrd waht I was rdanieg. The phaonmneal pweor of the hmuan mnid, aoccdrnig to a rscheearch at Cmabrigde Uinervtisy, it dseno’t mtaetr in waht oerdr the ltteres in a wrod are, the olny iproamtnt tihng is taht the frsit and lsat ltteer be in the rghit pclae. The rset can be a taotl mses and you can sitll raed it whotuit a pboerlm. Tihs is bcuseae the huamn mnid deos not raed ervey lteter by istlef, but the wrod as a wlohe. Azanmig huh? yaeh and I awlyas tghuhot slpeling was ipmorantt! if you can raed tihs pselse bolg it.