Update of /cvsroot/springnet/Spring.Net/doc/reference/src
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv6559
Modified Files:
remoting-quickstart.xml services.xml webservices.xml
Log Message:
updates docs on example with portable service abstraction.
change NotImplementedException to InvalidOperationException in SimpleInstantiationStrategy.
Index: webservices.xml
===================================================================
RCS file: /cvsroot/springnet/Spring.Net/doc/reference/src/webservices.xml,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** webservices.xml 10 Oct 2007 03:03:28 -0000 1.11
--- webservices.xml 15 Oct 2007 23:32:33 -0000 1.12
***************
*** 46,49 ****
--- 46,53 ----
implementation.</para>
+ <para>An example using the web service exporter can be found in quickstart
+ example named 'calculator'. More information can be found here '<link
+ linkend="websvc-example">Web Services example</link>'.</para>
+
<sect2>
<title>Removing the need for .asmx files</title>
Index: services.xml
===================================================================
RCS file: /cvsroot/springnet/Spring.Net/doc/reference/src/services.xml,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** services.xml 10 Oct 2007 03:03:28 -0000 1.7
--- services.xml 15 Oct 2007 23:32:33 -0000 1.8
***************
*** 46,50 ****
programming .NET Enterprise Services. An excellent reference for such
information is Christian Nagel's "Enterprise Services with the .NET
! Framework"</para>
</sect1>
--- 46,52 ----
programming .NET Enterprise Services. An excellent reference for such
information is Christian Nagel's "Enterprise Services with the .NET
! Framework" Spring.NET includes an example of using these classes, the
! 'calculator' example. More information can be found in the section, .<link
! linkend="entsvc-example">NET Enterprise Services example.</link></para>
</sect1>
***************
*** 61,64 ****
--- 63,68 ----
<itemizedlist>
<listitem>
+
+
<classname>Spring.Enterprise.ServicedComponentExporter</classname>
Index: remoting-quickstart.xml
===================================================================
RCS file: /cvsroot/springnet/Spring.Net/doc/reference/src/remoting-quickstart.xml,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** remoting-quickstart.xml 9 Aug 2007 06:30:17 -0000 1.11
--- remoting-quickstart.xml 15 Oct 2007 23:32:33 -0000 1.12
***************
*** 1,5 ****
<?xml version="1.0" encoding="UTF-8"?>
<chapter id="remoting-quickstart">
! <title>.NET Remoting Quick start</title>
<sect1 id="qs-remoting-introduction">
--- 1,5 ----
<?xml version="1.0" encoding="UTF-8"?>
<chapter id="remoting-quickstart">
! <title>Portable Service Abstraction Quick Start</title>
<sect1 id="qs-remoting-introduction">
***************
*** 7,15 ****
<para>This quickstart demonstrates the basic usage of Spring.NET's
! remoting infrastructure. The infrastructure classes are located in the
<literal>Spring.Services</literal> assembly under the
! <literal>Spring.Services.Remoting</literal>namespace. The overall strategy
! is to export .NET objects on the server side as either CAO or SAO objects
! using <classname>CaoExporter</classname> or
<classname>SaoExporter</classname> and obtain references to these objects
on the client side using <classname>CaoFactoryObject</classname> and
--- 7,24 ----
<para>This quickstart demonstrates the basic usage of Spring.NET's
! portable service abstraction functionality. Sections 2-5 demonstrate the
! use of .NET Remoting, Section 6 shows the use of the
! ServicedComponentExporter for .NET Enterprise Services, and Section 7
! shows the use of the WebServiceExporter.</para>
! </sect1>
!
! <sect1 id="qs-remoting-projectstructure">
! <title>.NET Remoting Example</title>
!
! <para>The infrastructure classes are located in the
<literal>Spring.Services</literal> assembly under the
! <literal>Spring.Services.Remoting</literal> namespace. The overall
! strategy is to export .NET objects on the server side as either CAO or SAO
! objects using <classname>CaoExporter</classname> or
<classname>SaoExporter</classname> and obtain references to these objects
on the client side using <classname>CaoFactoryObject</classname> and
***************
*** 18,25 ****
to .NET remoting you may find the links to introductory remoting material
presented at the conclusion of this quickstart of some help.</para>
- </sect1>
-
- <sect1 id="qs-remoting-projectstructure">
- <title>The Remoting Sample Project</title>
<para>As usual with quick start examples in Spring.NET, the classes used
--- 27,30 ----
***************
*** 586,596 ****
</sect1>
<sect1 id="qs-remoting-additional">
<title>Additional Resources</title>
! <para>.NET remoting is a huge topic. Some introductory articles on .NET
! remoting can be found online at MSDN. Ingo Rammer is also a very good
! authority on .NET remoting, and the .NET Remoting FAQ (link below) which
! is maintained by Ingo is chock full of useful information.</para>
<para><itemizedlist>
--- 591,793 ----
</sect1>
+ <sect1>
+ <title id="entsvc-example">.NET Enterprise Services Example</title>
+
+ <para>The .NET Enterprise Services example is located in the project
+ Spring.Calculator.RegisterComponentServices.2005.csproj or
+ Spring.Calculator.RegisterComponentServices.2003.csproj, depending on the
+ use of .NET 1.1 or 2.0. The example uses the previous AdvancedCalculator
+ implementation and then imports the embedded configuration file
+ 'enterpriseServices.xml' from the namespace
+ Spring.Calculator.RegisterComponentServices.Config. The top level
+ configuration is shown below</para>
+
+ <programlisting> <spring>
+
+ <context>
+ <resource uri="config://spring/objects" />
+ <resource uri="assembly://Spring.Calculator.RegisterComponentServices/Spring.Calculator.RegisterComponentServices.Config/enterpriseServices.xml" />
+ </context>
+
+ <objects xmlns="http://www.springframework.net">
+ <description>Definitions of objects to be registered.</description>
+
+ <object id="calculatorService" type="Spring.Calculator.Services.AdvancedCalculator, Spring.Calculator.Services" />
+
+ </objects>
+
+ </spring></programlisting>
+
+ <para>The exporter that adapts the AdvancedCalculator for use as a
+ EnterpriseService component is defined first in enterpriseServices.xml.
+ Second is defined an exporter that will host the exported Enterprise
+ Services component application by signing the assembly, registering it
+ with the specified COM+ application name. If application does not exist it
+ will create it and configure it using values specified for Description,
+ AccessControl and Roles properties. The configuration file for
+ enterpriseServices.xml is shown below</para>
+
+ <para><programlisting><objects xmlns="http://www.springframework.net">
+
+ <description>enterpriseService</description>
+
+ <object id="calculatorComponent" type="Spring.EnterpriseServices.ServicedComponentExporter, Spring.Services">
+ <property name="TargetName" value="calculatorService" />
+ <property name="TypeAttributes">
+ <list>
+ <object type="System.EnterpriseServices.TransactionAttribute, System.EnterpriseServices" />
+ </list>
+ </property>
+ <property name="MemberAttributes">
+ <dictionary>
+ <entry key="*">
+ <list>
+ <object type="System.EnterpriseServices.AutoCompleteAttribute, System.EnterpriseServices" />
+ </list>
+ </entry>
+ </dictionary>
+ </property>
+ </object>
+
+ <object type="Spring.EnterpriseServices.EnterpriseServicesExporter, Spring.Services">
+ <property name="ApplicationName">
+ <value>Spring Calculator Application</value>
+ </property>
+ <property name="Description">
+ <value>Spring Calculator application.</value>
+ </property>
+ <property name="AccessControl">
+ <object type="System.EnterpriseServices.ApplicationAccessControlAttribute, System.EnterpriseServices">
+ <property name="AccessChecksLevel">
+ <value>ApplicationComponent</value>
+ </property>
+ </object>
+ </property>
+ <property name="Roles">
+ <list>
+ <value>Admin : Administrator role</value>
+ <value>User : User role</value>
+ <value>Manager : Administrator role</value>
+ </list>
+ </property>
+ <property name="Components">
+ <list>
+ <ref object="calculatorComponent" />
+ </list>
+ </property>
+ <property name="Assembly">
+ <value>Spring.Calculator.EnterpriseServices</value>
+ </property>
+ </object>
+
+ </objects></programlisting></para>
+ </sect1>
+
+ <sect1 id="websvc-example">
+ <title>Web Services Example</title>
+
+ <para>The WebServices example shows how to export the AdvancedCalculator
+ as a web service an AOP proxy of AdvancedCalculator that has logging
+ advice applied to it. The main configuration file, Web.config, includes
+ information from three locations as shown below</para>
+
+ <programlisting> <context>
+ <resource uri="config://spring/objects"/>
+ <resource uri="~/Config/webServices.xml"/>
+ <resource uri="~/Config/webServices-aop.xml"/>
+ </context></programlisting>
+
+ <para>The config section 'spring/objects' in Web.config contains the
+ definition for the 'plain' Advancd calculator, as well as the definitions
+ to create an AOP proxy of an AdvancedCalculator that adds logging advice.
+ These definitions are shown below<programlisting> <objects xmlns="http://www.springframework.net">
+
+ <!-- Aspect -->
+
+ <object id="CommonLoggingAroundAdvice" type="Spring.Aspects.Logging.CommonLoggingAroundAdvice, Spring.Aspects">
+ <property name="Level" value="Debug"/>
+ </object>
+
+ <!-- Service -->
+
+ <!-- 'plain object' for AdvancedCalculator -->
+ <object id="calculator" type="Spring.Calculator.Services.AdvancedCalculator, Spring.Calculator.Services"/>
+
+ <!-- AdvancedCalculator object with AOP logging advice applied. -->
+ <object id="calculatorWeaved" type="Spring.Aop.Framework.ProxyFactoryObject, Spring.Aop">
+ <property name="target" ref="calculator"/>
+ <property name="interceptorNames">
+ <list>
+ <value>CommonLoggingAroundAdvice</value>
+ </list>
+ </property>
+ </object>
+
+ </objects></programlisting>The configuraiton file webService.xml
+ simply exports the named calculator object </para>
+
+ <programlisting> <object id="calculatorService" type="Spring.Web.Services.WebServiceExporter, Spring.Web">
+ <property name="TargetName" value="calculator" />
+ <property name="Namespace" value="http://SpringCalculator/WebServices" />
+ <property name="Description" value="Spring Calculator Web Services" />
+ </object></programlisting>
+
+ <para>Whereas the webService-aop.xml exports the calculator instance that
+ has AOP advice applied to it.</para>
+
+ <programlisting> <object id="calculatorServiceWeaved" type="Spring.Web.Services.WebServiceExporter, Spring.Web">
+ <property name="TargetName" value="calculatorWeaved" />
+ <property name="Namespace" value="http://SpringCalculator/WebServices" />
+ <property name="Description" value="Spring Calculator Web Services" />
+ </object>
+ </programlisting>
+
+ <para>Setting the project to run web project as the startup, you will be
+ presented with a screen as shown below</para>
+
+ <para><mediaobject>
+ <imageobject>
+ <imagedata fileref="images/web-exporter-calc-svc-main.jpg"
+ format="JPG" />
+ </imageobject>
+ </mediaobject>Selecting the CalculatorService and
+ CalculatorServiceWeaved links will bring you to the standard user
+ interface generated for browsing a web service, as shown below<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/web-exporter-calc-svc.jpg" />
+ </imageobject>
+ </mediaobject></para>
+
+ <para>And similarly for the calculator service with AOP applied</para>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/web-exporter-calc-svc-aop.jpg" />
+ </imageobject>
+ </mediaobject>
+
+ <para>Invoking the Add method for calculatorServiceWeaved shows the
+ screen</para>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/web-exporter-calc-svc-aop-add.jpg" />
+ </imageobject>
+ </mediaobject>
+
+ <para>Invoking add will then show the result '4' in a new browser instance
+ and the log file log.txt will contain the following entires</para>
+
+ <programlisting>2007-10-15 17:59:47,375 [DEBUG] Spring.Aspects.Logging.CommonLoggingAroundAdvice - Intercepted call : about to invoke method 'Add'
+ 2007-10-15 17:59:47,421 [DEBUG] Spring.Aspects.Logging.CommonLoggingAroundAdvice - Intercepted call : returned '4'</programlisting>
+ </sect1>
+
<sect1 id="qs-remoting-additional">
<title>Additional Resources</title>
! <para>Some introductory articles on .NET remoting can be found online at
! MSDN. Ingo Rammer is also a very good authority on .NET remoting, and the
! .NET Remoting FAQ (link below) which is maintained by Ingo is chock full
! of useful information.</para>
<para><itemizedlist>
|