Felix

Felix

  • NA
  • 1
  • 3k

why web service parameter null?

Mar 26 2013 10:55 AM
i have this web service 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Web.Services.Description;
using System.Xml;

namespace SDPReceiverWebService
{
    /// <summary>
    /// Summary description for RecieveSMS
    /// </summary>
    [WebService(Namespace = "http://www.csapi.org/wsdl/parlayx/sms/receive/v2_2/service")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    [SoapDocumentService(RoutingStyle = SoapServiceRoutingStyle.SoapAction)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    // [System.Web.Script.Services.ScriptService]
    public class RecieveSMS : System.Web.Services.WebService
    {

        [WebMethod]
        public string HelloWorld()
        {
            //ReceiveSmsManager.ReceiveSmsService f = new ReceiveSmsManager.ReceiveSmsService();
            //f. = "sd";            

            Utility.WriteLogFile.WriteToLogFile("webService", "notifySmsReception", "hello");
            return "Hello World";
        }

      
        [WebMethod]
        [SoapDocumentMethod("syncOrderRelation", ParameterStyle = SoapParameterStyle.Wrapped, Use = SoapBindingUse.Literal,
            RequestNamespace = "http://www.csapi.org/schema/parlayx/data/sync/v1_0/local")]
        public DataSyncManager.syncOrderRelationResponse syncOrderRelation(DataSyncManager.syncOrderRelation syncOrderRelation)
        {
            DataSyncManager.syncOrderRelationResponse syncOrderResponse = new DataSyncManager.syncOrderRelationResponse();
            syncOrderResponse.resultDescription = "OK";
            syncOrderResponse.result = 0;
            try
            {
                string message = "effectiveTime: " + syncOrderRelation.effectiveTime;
                message += ", expiryTime: " + syncOrderRelation.expiryTime;
                message += ", productID: " + syncOrderRelation.productID;
                message += ", serviceID: " + syncOrderRelation.serviceID;
                message += ", serviceList: " + syncOrderRelation.serviceList;
                message += ", spID: " + syncOrderRelation.spID;
                message += ", updateDesc: " + syncOrderRelation.updateDesc;
                message += ", updateTime: " + syncOrderRelation.updateTime;
                message += ", updateType: " + syncOrderRelation.updateType.ToString();
                message += ", userID.ID: " + syncOrderRelation.userID.ID;
                message += ", userID.type: " + syncOrderRelation.userID.type.ToString();

                DataSyncManager.NamedParameter[] namedParams = syncOrderRelation.extensionInfo;
                if (namedParams != null)
                {
                    string namedParamsValue = "";

                    for (int i = 0; i < namedParams.Length; i++)
                    {
                        if (string.IsNullOrEmpty(namedParamsValue))
                        {
                            namedParamsValue += "Key: " + namedParams[i].key + ", value: " + namedParams[i].value;
                        }
                        else
                        {
                            namedParamsValue += "<br>Key: " + namedParams[i].key + ", value: " + namedParams[i].value;
                        }
                    }

                    message += ", extensionInfo: " + namedParamsValue;
                }

                Utility.WriteLogFile.WriteToLogFile("webService", "notifySmsReception", message);

                return syncOrderResponse;
            }
            catch (Exception ex)
            {
                syncOrderResponse.resultDescription = ex.Message;
                syncOrderResponse.result = -1;
                Utility.WriteLogFile.WriteToLogFile("webService", "notifySmsReception", ex.Message);
                return syncOrderResponse;
            }
        }
    }
}

i call it with this data 

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:loc="http://www.csapi.org/schema/parlayx/data/sync/v1_0/local"> 
<soapenv:Header/> 
<soapenv:Body> 
<loc:syncOrderRelation> 
<loc:userID> 
<ID>254721214848</ID> 
<type>0</type> 
</loc:userID> 
<loc:spID>601399</loc:spID> 
<loc:productID>MDSP2000052892</loc:productID> 
<loc:serviceID>6013992000001442</loc:serviceID> 
<loc:serviceList>601399200000144</loc:serviceList> 
<loc:updateType>1</loc:updateType> 
<loc:updateTime>20120621232135</loc:updateTime> 
<loc:updateDesc>Addition</loc:updateDesc> 
<loc:effectiveTime>20120622001311</loc:effectiveTime> 
<loc:expiryTime>20120822001311</loc:expiryTime> 
<loc:extensionInfo> 
<namedParameters> 
<key>TransactionID</key> 
<value>1339730498361</value> 
<key>orderKey</key> 
<value>999000000009508556</value> 
<key>MDSPSUBEXPMODE</key> 
<value>1</value> 
<key>objectType</key> 
<value>1</value> 
<key>TraceUniqueID</key> 
<value>06212031580010010012</value> 
<key>rentSuccess</key> 
<value>false</value> 
</namedParameters> 
</loc:extensionInfo> 
</loc:syncOrderRelation> 
</soapenv:Body> 
</soapenv:Envelope>

why is the syncOrderRelation parameter null inside the syncOrderRelation method?

Answers (1)