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.

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

报告相同问题?

悬赏问题

  • ¥15 运筹学中在线排序的时间在线排序的在线LPT算法
  • ¥30 求一段fortran代码用IVF编译运行的结果
  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 lammps拉伸应力应变曲线分析
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试,帮帮忙吧