title: Webservices object reference not set to an instance of an object error
body: <p>I have to make a call to the web service (JSON) to authenticate the user who is trying to login to the app. I have the following xml provided </p>
  
  <pre><code>  &lt;summary&gt;
    http://geniewebsvc.cloudapp.net/Member.svc/Authenticate
   &lt;/summary&gt;
    &lt;param name="payload"&gt;
      {"UserName":"testuser@somedomain.com","Password":"p@$$w0rd"}
    &lt;/param&gt;
    &lt;requiredHeaders&gt;
    Content-Type: application/json;charset=UTF-8
    &lt;/requiredHeaders&gt;
    &lt;returns&gt;&lt;/returns&gt;
      [OperationContract]
      [WebInvoke(UriTemplate = "/Authenticate", Method = "POST", ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare)]
      AuthenticateResponse Authenticate(AuthCredentials usernamePassword);
  </code></pre>
  
  <p>There is similar one to check if the userid is already registered and that is a Get method. That works fine and i receive the right response for both successful and unsuccessful cases. But all the post methods are the ones which are giving me trouble. and i noticed that there is one more difference in these xmls.. i.e., the  .. the isregistered webservice param tag goes something like this..</p>
  
  <pre><code> &lt;param name="emailAddress"&gt;&lt;/param&gt;
  </code></pre>
  
  <p>and here is my get() and post() please let me know whats my mistake...</p>
  
  <pre><code>public void Post()
      {
          RequestState myRequestState = new RequestState();
          try
          {
              System.Uri uri = new Uri(url);
              HttpWebRequest myHttpWebGetRequest;
              Logger.log(TAG, "Create a HttpWebrequest object to the URL", url);
              myHttpWebGetRequest = (HttpWebRequest)WebRequest.Create(uri);
              _mHttpWebRequest = myHttpWebGetRequest;
              myRequestState.conn = this;
              myRequestState.request = myHttpWebGetRequest;
              myRequestState.request.ContentType = "application/json;charset=UTF-8";
  
              myRequestState.request.Method = "POST";
              myRequestState.request.AllowReadStreamBuffering = false;
              myRequestState.request.Headers["UserName"] = "rick.labarbera@gmail.com";
              myRequestState.request.Headers["Password"] = "125124514";
              // myRequestState.request.Headers["MemberId"] = "UdE8IwmTbxEjmzmMo2nBpg==";
  
              IAsyncResult result = (IAsyncResult)myHttpWebGetRequest.BeginGetResponse(new AsyncCallback(RespCallback), myRequestState);
          }
          catch (Exception e)
          {
              close(myRequestState);
              if (this.listener != null)
              {
                  Logger.log(TAG, "post()", e.Message);
              }
          }
      }
  
   public void Get()
      {
          RequestState myRequestState = new RequestState();
          try
          {
              System.Uri uri = new Uri(url);
              HttpWebRequest myHttpWebPostRequest;
              Logger.log(TAG, "Create a HttpWebrequest object to the URL", url);
              myHttpWebPostRequest = (HttpWebRequest)WebRequest.Create(uri);
              _mHttpWebRequest = myHttpWebPostRequest;
              myRequestState.conn = this;
              myRequestState.request = myHttpWebPostRequest;
              myRequestState.request.Method = "GET";
              myRequestState.request.AllowReadStreamBuffering = false;
  
              IAsyncResult result = (IAsyncResult)myHttpWebPostRequest.BeginGetResponse(new AsyncCallback(RespCallback), myRequestState);
          }
          catch (Exception e)
          {
              close(myRequestState);
              if (this.listener != null)
              {
                  Logger.log(TAG, "get()", e.Message);
              }
          }
      }
  </code></pre>
  
  <p>Am i doing something wrong???All these things are very very new to me.. I need help badly..</p>
  
  <p>Thanks :)</p>