Navigation

Showing posts with label Web. Show all posts
Showing posts with label Web. Show all posts

Friday, December 03, 2010

How to use IIS Compression with Web Services

Using IIS compression with web services is a simple way to provide better performance for your services.  This article will detail implementing this solution in IIS6 and IIS7.

First, you need to ensure that the web service proxy in your application has the following property set to true;

Dim myService as new localhost.service1
myService.EnableDecompression = True

This will ensure that your application takes advantage of the compression.

 

Second, you need to configure IIS compression on your server.  To do this ensure that you have the following installed;image

Then turn compression on in the IIS management console;

image

Then create a bat file in C:\inetpub\AdminScripts and place the following lines of code into the bat file;

IISreset.exe /stop
cscript.exe adsutil.vbs set w3svc/filters/compression/parameters/HcDoDynamicCompression true
cscript.exe adsutil.vbs set w3svc/filters/compression/parameters/HcDoStaticCompression true
cscript.exe adsutil.vbs set W3Svc/Filters/Compression/GZIP/HcFileExtensions "htm" "html" "txt" "ppt" "xls" "xml" "pdf" "xslt" "doc" "xsl" "htc" "js" "css"
cscript.exe adsutil.vbs set W3Svc/Filters/Compression/DEFLATE/HcFileExtensions "htm" "html" "txt" "ppt" "xls" "xml" "pdf" "xslt" "doc" "xsl" "htc" "js" "css"
cscript.exe adsutil.vbs set W3Svc/Filters/Compression/GZIP/HcScriptFileExtensions "asp" "dll" "exe" "aspx" "asmx" "ashx"
cscript.exe adsutil.vbs set W3Svc/Filters/Compression/DEFLATE/HcScriptFileExtensions "asp" "dll" "exe" "aspx" "asmx"
cscript.exe adsutil.vbs set W3Svc/Filters/Compression/DEFLATE/HcScriptFileExtensions "asp" "dll" "exe" "aspx" "asmx"
cscript.exe adsutil.vbs set W3Svc/Filters/Compression/DEFLATE/HcDynamicCompressionLevel "9"
IISreset.exe /restart

This will enable compression on your web service.

The following tool is a easy free application that allows you to compare the difference in your application communication between compressed and uncompressed communications of xml data.

http://devolutions.net/products/TCP-Spy-Net.aspx

image

Friday, June 25, 2010

Access WCF Service by WEBGet from Browser

If you want to expose a simple web service (WCF) so that it can be accessed by a web get or browser you need to first insure that the input and output are simple data types like strings or integers.

1.Create the web site project

2.  Add a reference to System.ServiceModel.Web (so we can access the WebGet decleration.

3.  Add your function and decerate it with the following;

<OperationContract()> _
    <WebGet()> _
    Function Dosmothing(ByVal pValue As String) As String




4.  Add the following to your web.config file;



 <webServices>
      <protocols>
        <add name="HttpGet"/>
        <add name="HttpPost"/>
      </protocols>
    </webServices>


 



5.  Update your service model to reflect the one below. 



<system.serviceModel>
<behaviors>
   <endpointBehaviors>
    <behavior name="NewBehavior">
     <webHttp />
    </behavior>
   </endpointBehaviors>
   <serviceBehaviors>
    <behavior name="my.Application.Behavior1">
     <serviceMetadata httpGetEnabled="true" />
     <serviceDebug includeExceptionDetailInFaults="false" />
    </behavior>
   </serviceBehaviors>
  </behaviors>
<services>
   <service behaviorConfiguration="Behavior1"
    name="myInterface">
    <endpoint behaviorConfiguration="NewBehavior" binding="webHttpBinding"
     bindingConfiguration="" contract="myInterface" />
   </service>
  </services>
</system.serviceModel>


6.Now you can access the function like this;


http://localhost:54433/myInterface.svc/DoSmothing?pValue=Smothing

Tuesday, May 11, 2010

IfixIt

This is a great website that provides free repair manuals for electronic devices. 

image

http://www.ifixit.com/

If you ever need to repair one of your devices this can be a great resource.

Tuesday, April 27, 2010

Silverlight Spy

Silverlight Spy provides detailed runtime inspection of any Silverlight application. Use the built-in browser to navigate to a web page.

Silverlight Spy automatically detects the applications embedded in the page and provides various inspection view panes. Explore the XAP package, Isolated Storage, monitor performance, browse the UI visual and logical tree, examine objects, execute code in the DLR shell and more.

http://firstfloorsoftware.com/silverlightspy

Friday, April 23, 2010

Silverlight 4 Overview Document

This is a link to a great document covering the technical features of the Silverlight 4.

http://ecn.channel9.msdn.com/o9/learn/Silverlight4/Labs/Overview/WhatsNewInSilverlight4.xps

Silverlight 4 Training Kit Released

This is a great complete training kit for getting started with Silverlight 4 from Scott Guthrie at Microsoft.  This provides a great step by step introduction to silverlight development for line of business applications.

Link to Scott Gu’s blog.

http://weblogs.asp.net/scottgu/archive/2010/04/22/silverlight-4-training-kit.aspx

Link to training course.

http://channel9.msdn.com/learn/courses/Silverlight4/

Wednesday, April 21, 2010

How to configure Windows Live Writer for Blogger

I started to use Windows Live Writer for posting to my blogger account and was getting this error when I tried to publish.

“The remote server returned an error: (403) Forbidden.”

Here is a great link on how to address the issue;

http://rebmordechaiwrites.blogspot.com/2009/12/how-to-configure-windows-live-writer.html