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


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

我目前正在从一个我似乎无法正确工作的表单发出SOAP请求。我检查了又检查了我的测试值是正确的,它似乎没有任何区别。

:

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

每当我尝试提交到SOAP api时。这是我的代码(它是在Joomla MVC组件结构,所以我将挑选出相关的代码):

这是我的控制器表单,它从表单中获取输入字段,并将它们放在一个数组中,然后发送到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);
        }

和调用适当SOAP函数的模型函数:

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);
}

正如您所看到的,我已经确保所有字段都有实际或测试数据,并且方法存在。此外,所有必需的字段都已被需要。我不知道为什么这不起作用,谷歌搜索无法解决我的问题。已经有一两天了,我希望有人能在这里帮忙!谢谢詹姆斯。

检查静态数据。还要检查数据类型是否与wsdl文件正确匹配。