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 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 关于大棚监测的pcb板设计
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用