trlongsky 发表于 2009-12-10 15:48:42

如何使用XML-RPC 发送request请求啊?

$this->load->helper('date');
              $title= $this->input->post('title');
              $content=$this->input->post('content');
      
              $format = 'DATE_W3C';
                  $time = time();
              $mydate=standard_date($format, $time);
       

          $this->load->library('xmlrpc');
                $this->xmlrpc->set_debug(true);   
                $this->xmlrpc->server('XML-RPC RUL', 80);
                $this->xmlrpc->method('方法名');
                $post=array(
                array( $mydate,'dateTime.iso8601'),
                array( $content,'string'),
                array( $title,'string')
               
                );
                       
                $request = array(
                array('23','string'),
                array('用户名','string'),
                array('密码','string'),
                array($post,'struct'),
                array('true','boolean'));
                               
                //print_r( $request);
                $this->xmlrpc->request($request);
               
                if ( ! $this->xmlrpc->send_request())
                {
                  echo $this->xmlrpc->display_error();
                }


请问我以上代码正确吗?高手指点

Hex 发表于 2009-12-10 16:33:01

调用出什么错了吗?

trlongsky 发表于 2009-12-10 16:52:39

回复 2# Hex

<string>值不能为空。
参数名: input</string>

这个参数我调的方法里并没有
页: [1]
查看完整版本: 如何使用XML-RPC 发送request请求啊?