Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Compression and Web Services

  1. #1
    Join Date
    Dec 2004
    Posts
    6

    Default Compression and Web Services

    Hi,

    I was very impressed to see the results of your integration of Web Services into the Spring Framework.

    I was wondering whether you have any ideas on how to implement compression of the data sent between the server and client for web service calls?

    There are many examples of overriding the GetWebResponse/GetWebRequest methods and then compressing/decompressing the data either manually or using the gzip/deflate capabilities of the web server.

    But given that Spring creates a proxy to deal with the underlying .NET framework classes, I wanted to know how I could achieve this.

    Thanks in advance,

    Mike

  2. #2
    Join Date
    Dec 2004
    Posts
    6

    Default

    Argh!

    I also see that this is coming in 0.7 not the current release - at what stage is the development of this functionality - does the current CVS version contain it? Is it stable? When (the perennial question for you, no doubt) will 0.7 be released?

    Cheers again,

    Mike

  3. #3
    Join Date
    Sep 2004
    Location
    Belgrade, Serbia
    Posts
    613

    Default

    Hi Mike,

    Web services code is in CVS, along with a lot of other stuff that is not part of the current release. I believe latest interim build also contains web services stuff in a binary format.

    As for the compression, proxy could have necessary logic, or it could be added using AOP interceptor (seems like a perfect scenario for it, actually). If you can point me to a good article describing recommended implementation approach I will take a look at it.

    Regards,

    Aleks

  4. #4
    Join Date
    Oct 2005
    Location
    Belgium
    Posts
    213

    Default

    I'd like to implement this, but what do I need to proxy? . The WebServiceExporter and WebServiceClientFactory ?
    Last edited by .ben; 02-08-2007 at 11:19 AM. Reason: typo

  5. #5
    Join Date
    Oct 2005
    Location
    Toulouse, France
    Posts
    1,407

    Default

    Hi,

    If you need to do something on the server side, the aspect should be applied on the service to be exported via WebServiceExporter.

    If you need to do something on the client side, the aspect should be applied on the WebServiceClientFactory.


    Do you gonna use WSE, WCF or something with http 1.1 compression (if possible) ?
    Anyway, there is an example for an authentification aspect using WSE2 integration under "sandbox\Integrations\Spring.Web.Services2".
    The approach is the same.

    I'll be working soon on the WebServiceClientFactory for the RC1, and will create an WSE3 integration with at least one aspect to show the approach.
    Then users will be able to contribute with their own aspects.

    Hope this helps,
    Bruno
    My english is as poor as my taylor is rich

  6. #6
    Join Date
    Oct 2005
    Location
    Belgium
    Posts
    213

    Default

    I know, I've allready used aspects on both to enable security etc.

    Now I need to perform compression of the returned / send data, but I don't know how I can get hold of the returned/send xml string to compress it.

  7. #7
    Join Date
    Oct 2005
    Location
    Toulouse, France
    Posts
    1,407

    Default

    Take a look to SoapExtension :
    http://msdn2.microsoft.com/en-us/lib...extension.aspx

    Hope this helps,
    Bruno
    My english is as poor as my taylor is rich

  8. #8
    Join Date
    Oct 2005
    Location
    Belgium
    Posts
    213

    Default

    I think I have it running on the server side. I used this article.

    Server config:
    Code:
     <object id="AdvertisementWebService" type="Spring.Web.Services.WebServiceExporter, Spring.Web">
        <property name="TargetName" value="DistributedAdvertisementWebServiceProxy"/>
        <property name="Name" value="AdvertisementWebService"/>
        <property name="Namespace" value="http://WebServices"/>
        <property name="Description" value="Advertisement Web Service"/>
        <property name="Interfaces">
          <list>
            <value>WebservicesContracts.IAdvertisementWebService</value>
          </list>
        </property>
        <property name="MemberAttributes">
    		<dictionary>
    			<entry key="*">
    				<object type="MasterCSharp.WebServices.CompressionExtensionAttribute, CompressionExtension"/>
    			</entry>
    		</dictionary>
    	</property>
      </object>
    The only thing left, is to add some configuration to the clientfactory. Something like mentioned above cfr MemberAttributes. But how?
    Code:
     <object id="AdvertisementWebservice" type="Spring.Web.Services.WebServiceClientFactory, Spring.Services">
    	  <property name="ServiceUrl" value="http://localhost:1332/Webservices/AdvertisementWebService.asmx"></property>
       	<property name="ServiceInterface" value="WebservicesContracts.IAdvertisementWebService, WebservicesContracts"></property>
     </object>
    Last edited by .ben; 02-16-2007 at 09:44 AM.

  9. #9
    Join Date
    Oct 2005
    Location
    Toulouse, France
    Posts
    1,407

    Default

    Hi,

    Quote Originally Posted by .ben View Post
    The only thing left, is to add some configuration to the clientfactory. Something like mentioned above cfr MemberAttributes. But how?
    Code:
     <object id="AdvertisementWebservice" type="Spring.Web.Services.WebServiceClientFactory, Spring.Services">
    	  <property name="ServiceUrl" value="http://localhost:1332/Webservices/AdvertisementWebService.asmx"></property>
       	<property name="ServiceInterface" value="WebservicesContracts.IAdvertisementWebService, WebservicesContracts"></property>
     </object>
    I gonna add TypeAttributes & MemberAttributes to be able to add attributes the proxy type and members.
    Then we should have something like in the server side.


    Bruno
    My english is as poor as my taylor is rich

  10. #10
    Join Date
    Oct 2005
    Location
    Toulouse, France
    Posts
    1,407

    Default

    Done.
    You can get the latest chenge from CVS or wait for the next nightly build.

    Notice that I changed the 'ServiceUrl' property name to 'ServiceUri'.
    See this thread to know why.

    You should get something like that :
    Code:
    <object id="AdvertisementWebservice" type="Spring.Web.Services.WebServiceClientFactory, Spring.Services">
       <property name="ServiceUri" value="http://localhost:1332/Webservices/AdvertisementWebService.asmx"></property>
       <property name="ServiceInterface" value="WebservicesContracts.IAdvertisementWebService, WebservicesContracts"></property>
       <property name="MemberAttributes">
          <dictionary>
             <entry key="*">
                <object type="MasterCSharp.WebServices.CompressionExtensionAttribute, CompressionExtension"/>
             </entry>
          </dictionary>
       </property>
    </object>

    Bruno
    My english is as poor as my taylor is rich

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •