title: SOAP Request - Error: 0 Server was unable to process request. ---> Value cannot be null. Parameter name: g
body: <p>I am currently making a SOAP request from a form that I cannot seem to get working correctly. I have checked and double checked that my test values are correct and it doesn't seem to make any difference at all.</p>
  
  <p>I get:</p>
  
  <p>"Error: 0 Server was unable to process request. ---> Value cannot be null.
  Parameter name: g"</p>
  
  <p>whenever I try and submit to the SOAP api.
  Here is my code (it is within Joomla MVC component structure so I will pick out the relevant code):</p>
  
  <p>Here is my contoller form that takes the input fields from the form and puts them in an array to be sent to the SOAP api:</p>
  
  <pre><code>public function submitForm1 () {
              $input = JFactory::getApplication()-&gt;input;                             
              $postVar = array();
              //$time = date("m-d- G-i-s", $_POST['dob']);
  
              $postVar['title']         = $input-&gt;get('title', null, 'string');
              $postVar['firstname']     = $input-&gt;get('firstname', null, 'string');
              $postVar['lastname']      = $input-&gt;get('lastname', null, 'string');
              $postVar['email']         = $input-&gt;get('email', null, 'string');
              $postVar['mobile']        = $input-&gt;get('mobile', null, 'string');
              $postVar['home']          = $input-&gt;get('home', null, 'string');
              //'dob' needs to be amended
              $postVar['dob']           = date("Y-m-d",strtotime(time()));
              $postVar['addline1']      = $input-&gt;get('addline1', null, 'string');
              $postVar['addline2']      = $input-&gt;get('addline2', null, 'string');
              $postVar['addline3']      = $input-&gt;get('addline3', null, 'string');
              $postVar['town']          = $input-&gt;get('town', null, 'string');
              $postVar['county']        = $input-&gt;get('county', null, 'string');
              $postVar['postcode']      = $input-&gt;get('postcode', null, 'string');
              $postVar['gender']        = $input-&gt;get('gender', null, 'string');
              //'membertype' needs to be amended
              $postVar['membertype']    = "test";
              $postVar['gymguid']       = $input-&gt;get('gymguid', null, 'string');         
              $postVar['rateguid']      = $input-&gt;get('rateguid', null, 'string');
              //These questions need to be amended
              $postVar['WheredidyouhearaboutFitspace'] = "test";
              $postVar['Whydoyouwantojointhegym']      = "test";
              $postVar['socialfacebook']               = "test";
              $postVar['socialtwitter']                = "test";
              $postVar['socialfoursquare']             = "test";
              //These dd details need to be amended               
              $postVar['DDrefnum']             = "test";              
              $postVar['promoguid']            = "test";
              $postVar['DDfirstpayment']       = date("Y-m-d",strtotime(time()));     
              $postVar['StartofCurrentCon']    = date("Y-m-d",strtotime(time()));
              $postVar['DDdayofmonth']         = 0; //Int
              if(isset($postVar['student'])) {
                  $postVar['student'] = $input-&gt;get('student', null, 'int');;
              } else {
                  $postVar['student'] = 0;
              }           
              $postVar['PT']                   = 0;
              $postVar['ContactOptOut']        = 0;
              $postVar['gyminductiondeclined'] = 0;
              $postVar['Pinrequired']          = 0;
  
  
              $model = $this-&gt;getModel('signup');
              $model-&gt;submitForm1($postVar);
  
          }
  </code></pre>
  
  <p>and the model function which calls the appropriate SOAP function:</p>
  
  <pre><code>public function submitForm1($postVar) {
      $client = $this-&gt;createSoapRequest();
      $url = 'https://webservice.com/MHservice.asmx?WSDL';
          $options["connection_timeout"] = 25;
          $options["location"] = $url;
          $options['trace'] = 1;
          $options['style'] = SOAP_RPC;
          $options['use'] = SOAP_ENCODED;
  
          $client = new SoapClient($url, $options);
  
      $response = $client-&gt;FITaddupdatemember($postVar);
  
  }
  </code></pre>
  
  <p>As you can see I have ensured that all fields have real or test data put in and the method exists. Also, all fields thar are required have been required.
  I have no idea why this isn't working and Google searches have not been able to solve my problem. It's been a day or two now and was hoping somebody maybe able to help on here!
  Thanks
  James</p>