Results 1 to 2 of 2

Thread: ServiceExporter proxy throws NullReferenceException

  1. #1
    Join Date
    Mar 2011
    Posts
    1

    Default ServiceExporter proxy throws NullReferenceException

    I attempted to change wcfQuickStart with ServiceExporter

    server:
    <object id="calculatorServiceExporter" type="Spring.ServiceModel.ServiceExporter, Spring.Services">
    <property name="Namespace" value="http://www.minstars.cn/" />
    <property name="TargetName" value="calculator"/>
    <property name="ContractInterface" expression="T(Spring.WcfQuickStart.ICalculator, Spring.WcfQuickStart.Contracts)"></property>
    <property name="MemberAttributes">
    <dictionary>
    <entry key="Add">
    <object type="System.ServiceModel.OperationContractAttribu te, System.ServiceModel">
    <!-- property name="IsOneWay" value="false"/-->
    <!--configure any other OperationContractAttribute properties here-->
    </object>
    </entry>
    <entry key="Subtract">
    <object type="System.ServiceModel.OperationContractAttribu te, System.ServiceModel">
    <property name="IsOneWay" value="false"/>
    </object>
    </entry>
    <entry key="Multiply">
    <object type="System.ServiceModel.OperationContractAttribu te, System.ServiceModel">
    <property name="IsOneWay" value="false"/>
    </object>
    </entry>
    <entry key="Divide">
    <object type="System.ServiceModel.OperationContractAttribu te, System.ServiceModel">
    <property name="IsOneWay" value="false"/>
    </object>
    </entry>
    <entry key="GetName">
    <object type="System.ServiceModel.OperationContractAttribu te, System.ServiceModel">
    <property name="IsOneWay" value="false"/>
    </object>
    </entry>
    <entry key="Power">
    <object type="System.ServiceModel.OperationContractAttribu te, System.ServiceModel">
    <property name="IsOneWay" value="false"/>
    </object>
    </entry>
    </dictionary>
    </property>
    </object>

    <object id="calculatorServiceHost" type="Spring.ServiceModel.Activation.ServiceHostFa ctoryObject, Spring.Services">
    <property name="TargetName" value="calculatorServiceExporter" />
    </object>

    client is not change

    Server stack trace:
    在 System.ServiceModel.Channels.ServiceChannel.ThrowI fFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)
    在 System.ServiceModel.Channels.ServiceChannel.Handle Reply(ProxyOperationRuntime operation, ProxyRpc& rpc)
    在 System.ServiceModel.Channels.ServiceChannel.Call(S tring action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
    在 System.ServiceModel.Channels.ServiceChannel.Call(S tring action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
    在 System.ServiceModel.Channels.ServiceChannelProxy.I nvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
    在 System.ServiceModel.Channels.ServiceChannelProxy.I nvoke(IMessage message)

    Exception rethrown at [0]:
    在 System.Runtime.Remoting.Proxies.RealProxy.HandleRe turnMessage(IMessage reqMsg, IMessage retMsg)
    在 System.Runtime.Remoting.Proxies.RealProxy.PrivateI nvoke(MessageData& msgData, Int32 type)
    在 Spring.WcfQuickStart.ICalculator.GetName()
    在 _dynamic_Spring.WcfQuickStart.ICalculator.GetName( Object , Object[] )
    在 Spring.Reflection.Dynamic.SafeMethod.Invoke(Object target, Object[] arguments) 位置 c:\_svn\spring-net\tags\spring-net-1.3.1\src\Spring\Spring.Core\Reflection\Dynamic\Dy namicMethod.cs:行号 156
    在 Spring.Aop.Framework.DynamicMethodInvocation.Invok eJoinpoint() 位置 c:\_svn\spring-net\tags\spring-net-1.3.1\src\Spring\Spring.Aop\Aop\Framework\DynamicM ethodInvocation.cs:行号 100
    在 Spring.Aop.Framework.AbstractMethodInvocation.Proc eed() 位置 c:\_svn\spring-net\tags\spring-net-1.3.1\src\Spring\Spring.Aop\Aop\Framework\Abstract MethodInvocation.cs:行号 259
    在 Spring.WcfQuickStart.SimplePerformanceInterceptor. Invoke(IMethodInvocation invocation) 位置 C:\Spring.NET\Spring.NET-1.3.1\examples\Spring\Spring.WcfQuickStart\src\Spr ing.WcfQuickStart.Aspects\SimplePerformanceInterce ptor.cs:行号 23
    在 Spring.Aop.Framework.AbstractMethodInvocation.Proc eed() 位置 c:\_svn\spring-net\tags\spring-net-1.3.1\src\Spring\Spring.Aop\Aop\Framework\Abstract MethodInvocation.cs:行号 284
    在 Spring.Aop.Framework.DynamicProxy.AdvisedProxy.Inv oke(Object proxy, Object target, Type targetType, MethodInfo targetMethod, MethodInfo proxyMethod, Object[] args, IList interceptors) 位置 c:\_svn\spring-net\tags\spring-net-1.3.1\src\Spring\Spring.Aop\Aop\Framework\DynamicP roxy\AdvisedProxy.cs:行号 208
    在 CompositionAopProxy_3c50e150204247fc9babdd8208ae1f cf.GetName()
    在 Spring.WcfQuickStart.ClientApp.Program.Main() 位置 C:\Spring.NET\Spring.NET-1.3.1\examples\Spring\Spring.WcfQuickStart\src\Spr ing.WcfQuickStart.ClientApp\Program.cs:行号 48


    在 calculatorServiceExporter..ctor()
    在 CreatecalculatorServiceExporter()
    在 System.ServiceModel.Dispatcher.InstanceBehavior.In stanceProvider.GetInstance(InstanceContext instanceContext, Message message)
    在 System.ServiceModel.Dispatcher.InstanceBehavior.Ge tInstance(InstanceContext instanceContext, Message request)
    在 System.ServiceModel.InstanceContext.GetServiceInst ance(Message message)
    在 System.ServiceModel.Dispatcher.ImmutableDispatchRu ntime.ProcessMessage5(MessageRpc& rpc)
    在 System.ServiceModel.Dispatcher.ImmutableDispatchRu ntime.ProcessMessage4(MessageRpc& rpc)
    在 System.ServiceModel.Dispatcher.ImmutableDispatchRu ntime.ProcessMessage3(MessageRpc& rpc)
    在 System.ServiceModel.Dispatcher.ImmutableDispatchRu ntime.ProcessMessage2(MessageRpc& rpc)
    在 System.ServiceModel.Dispatcher.ImmutableDispatchRu ntime.ProcessMessage1(MessageRpc& rpc)
    在 System.ServiceModel.Dispatcher.MessageRpc.Process( Boolean isOperationContextSet)


    ICalculator change:
    //[ServiceContract(Namespace = "http://Spring.WcfQuickStart")]
    public interface ICalculator
    {
    //[OperationContract]
    double Add(double n1, double n2);
    //[OperationContract]
    double Subtract(double n1, double n2);
    //[OperationContract]
    double Multiply(double n1, double n2);
    //[OperationContract]
    double Divide(double n1, double n2);
    //[OperationContract]
    string GetName();
    //[OperationContract]
    OperationResult Power(BinaryOperationArgs args);
    }
    Last edited by shenlos; 03-22-2011 at 07:05 AM.

  2. #2
    Join Date
    Jul 2010
    Posts
    245

    Default

    Can you please attempt this again using the latest Nightly Build and let us know if the issue persists?

    Thanks,

    -Steve B.

Tags for this Thread

Posting Permissions

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