douqie1884 2013-05-15 13:50
浏览 204
已采纳

SOAP请求 - 错误:0服务器无法处理请求。 --->值不能为空。 参数名称:g

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.

I get:

"Error: 0 Server was unable to process request. ---> Value cannot be null. Parameter name: g"

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):

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:

public function submitForm1 () {
            $input = JFactory::getApplication()->input;                             
            $postVar = array();
            //$time = date("m-d- G-i-s", $_POST['dob']);

            $postVar['title']         = $input->get('title', null, 'string');
            $postVar['firstname']     = $input->get('firstname', null, 'string');
            $postVar['lastname']      = $input->get('lastname', null, 'string');
            $postVar['email']         = $input->get('email', null, 'string');
            $postVar['mobile']        = $input->get('mobile', null, 'string');
            $postVar['home']          = $input->get('home', null, 'string');
            //'dob' needs to be amended
            $postVar['dob']           = date("Y-m-d",strtotime(time()));
            $postVar['addline1']      = $input->get('addline1', null, 'string');
            $postVar['addline2']      = $input->get('addline2', null, 'string');
            $postVar['addline3']      = $input->get('addline3', null, 'string');
            $postVar['town']          = $input->get('town', null, 'string');
            $postVar['county']        = $input->get('county', null, 'string');
            $postVar['postcode']      = $input->get('postcode', null, 'string');
            $postVar['gender']        = $input->get('gender', null, 'string');
            //'membertype' needs to be amended
            $postVar['membertype']    = "test";
            $postVar['gymguid']       = $input->get('gymguid', null, 'string');         
            $postVar['rateguid']      = $input->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->get('student', null, 'int');;
            } else {
                $postVar['student'] = 0;
            }           
            $postVar['PT']                   = 0;
            $postVar['ContactOptOut']        = 0;
            $postVar['gyminductiondeclined'] = 0;
            $postVar['Pinrequired']          = 0;


            $model = $this->getModel('signup');
            $model->submitForm1($postVar);

        }

and the model function which calls the appropriate SOAP function:

public function submitForm1($postVar) {
    $client = $this->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->FITaddupdatemember($postVar);

}

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

  • 写回答

1条回答 默认 最新

  • drxt70655 2013-05-15 14:00
    关注

    Check with static data. Also check if the data type is correctly matching with your wsdl file.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥30 求给定范围的全体素数p的(p-2)的连乘积
  • ¥15 VFP如何使用阿里TTS实现文字转语音?
  • ¥100 需要跳转番茄畅听app的adb命令
  • ¥50 寻找一位有逆向游戏盾sdk 应用程序经验的技术
  • ¥15 请问有用MZmine处理 “Waters SYNAPT G2-Si QTOF质谱仪在MSE模式下采集的非靶向数据” 的分析教程吗
  • ¥50 opencv4nodejs 如何安装
  • ¥15 adb push异常 adb: error: 1409-byte write failed: Invalid argument
  • ¥15 nginx反向代理获取ip,java获取真实ip
  • ¥15 eda:门禁系统设计
  • ¥50 如何使用js去调用vscode-js-debugger的方法去调试网页