[WebMethod]
    [SoapRpcMethod(Action = "http://adc.siinterface.com/ADCSIInterface", Use = SoapBindingUse.Literal)]
    [XmlInclude(typeof(AdcSiRequest))]
    public AdcSiResponse ADCSIInterface(AdcSiRequest request)
    {
        AdcSiResponse AdcSiResponse = new AdcSiResponse();
        Request = new Request();
        try
        {
            switch (request.BizCode.ToUpper())
            {
                case "SI101"://SSO鉴权接口
                    AdcSiResponse = Request.RequestSI101(request);
                    break;
                case "SI102"://SSO心跳接口
                    AdcSiResponse = Request.RequestSI102(request);
                    break;
                case "SI201"://服务开通请求接口
                    AdcSiResponse = Request.RequestSI201(request);
                    break;
                case "SI301"://成员管理接口
                    AdcSiResponse = Request.RequestSI301(request);
                    break;
                default:
                    AdcSiResponse = null;
                    break;            }        }
        catch (Exception ex)
        {
            WriteData.WriteLine("123456789" + ex.ToString());
        }
        WriteData.WriteLine(adc.ActionCode.ToString());
        return AdcSiResponse;}
这个是我在webservice中写,现在发现我接收到的AdcSiRequest类型 对象是空的,但是我抓包出来,这个是对象不是空,提示错误:System.NullReferenceException: 未将对象引用设置到对象的实例。
   在 SIInterfaceForADC.ADCSIInterface(AdcSiRequest request) 
是什么原因造成的?

解决方案 »

  1.   

    SIInterfaceForADC是什么?实例化了吗?
      

  2.   

    AdcSiRequest中有[Serializable()]吗?
      

  3.   

    通过null判断看看
    http://www.cnblogs.com/beniao/archive/2008/04/30/1175248.html
      

  4.   

    web Service桥只支持httpGet协议
    Web.config文件中开启HttpGet方式(默认为HttpPost)。<webServices>
          <protocols>
            <add name="HttpGet"/>
          </protocols>
        </webServices>
      

  5.   

    自定义类那边[SoapType(Namespace = " http://adc.siinterface.com")]少些了这个,郁闷啊,弄了两天才解决,谢谢大家的帮忙啊