Patrick's Bytes

2, July 2008

Office Tips: Line Breaks Without Bullets

Filed under: Office,Word — patrickyong @ 11:37 am

Tested on Word 2007

When you’re creating a bulleted or numbered list in Microsoft Office Word or Microsoft Office PowerPoint, you might want an item to appear in the list without a bullet or without incrementing the number. You can start a new line without a bullet by pressing SHIFT+ENTER. The next time you press the ENTER key, the new line will continue the bulleted or numbered list.

Passing large files over WCF channel

Filed under: WCF — patrickyong @ 10:32 am

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>

Blog at WordPress.com.