diff --git a/src/Spring/Spring.Web/Web/Services/WebServiceExporter.cs b/src/Spring/Spring.Web/Web/Services/WebServiceExporter.cs
index b3b90ca1..c4a867fd 100644
--- a/src/Spring/Spring.Web/Web/Services/WebServiceExporter.cs
+++ b/src/Spring/Spring.Web/Web/Services/WebServiceExporter.cs
@@ -505,30 +505,20 @@ namespace Spring.Web.Services
protected override void ImplementConstructors(TypeBuilder builder)
{
MethodAttributes attributes = MethodAttributes.Public |
- MethodAttributes.HideBySig | MethodAttributes.SpecialName |
- MethodAttributes.RTSpecialName;
+ MethodAttributes.HideBySig | MethodAttributes.SpecialName |
+ MethodAttributes.RTSpecialName;
ConstructorBuilder cb = builder.DefineConstructor(
attributes, CallingConventions.Standard, Type.EmptyTypes);
ILGenerator il = cb.GetILGenerator();
- il.Emit(OpCodes.Ret);
- }
- ///
- /// Generates the IL instructions that pushes
- /// the target instance on which calls should be delegated to.
- ///
- ///
- /// This will cause the builder to generate
- /// WebServiceExporter.GetTarget( EXPORTER_ID ).<targetmethod>(..)
- /// for each exported method.
- ///
- /// The IL generator to use.
- public override void PushTarget( ILGenerator il )
- {
- il.Emit( OpCodes.Ldstr, this.exporter.EXPORTER_ID );
+ il.Emit(OpCodes.Ldarg_0);
+ il.Emit(OpCodes.Ldstr, this.exporter.EXPORTER_ID);
il.Emit( OpCodes.Call, WebServiceExporter_GetTargetInstance );
+ il.Emit(OpCodes.Stfld, targetInstance);
+
+ il.Emit(OpCodes.Ret);
}
protected override IList GetTypeAttributes(Type type)