Welcome Guest, Not a member yet? Register   Sign In
help me for xmlrpc error
#1

[eluser]chmod[/eluser]
xmlrpc server:
IP:192.168.1.134
system/controller/webservice.php

----------------------------
<?
class Webservice extends Controller{
function index(){
$this->load->library('xmlrpc');
$this->load->library('xmlrpcs');
$this->load->library('MY_Xmlrpc');
$config['functions']['Check_isconnect'] = array('function' => 'webservice.Check_isconnect');
$this->xmlrpcs->initialize($config);
$this->xmlrpcs->serve();
}

function Check_isconnect($request){
$parm = $request->output_parameters();
$conn = mssql_connect('192.168.1.134','liujun','123456') or die('cannot connect to db');
mssql_select_db('demo');
$stmt = mssql_init("isconnect", $conn);
mssql_bind($stmt, "@accountid", $parm[0], SQLVARCHAR, FALSE);
$result = mssql_execute($stmt);
return $this->xmlrpc->send_response(array($result),'struct');
}
}
?>
----------------------------

client:
IP:localhost
system/controller/client.php
<?
class Client extends Controller{

function index(){
$this->load->library('xmlrpc');
$this->load->library('MY_Xmlrpc');
$this->xmlrpc->set_debug(TRUE);
$this->xmlrpc->server('http://192.168.1.134/webservice','80');


$this->xmlrpc->method('isconnect');
$request = array('liujun');
$this->xmlrpc->request($request);

if ( ! $this->xmlrpc->send_request())
{
echo $this->xmlrpc->display_error();
}
else
{
echo '<pre>';
print_r($this->xmlrpc->display_response());
echo '</pre>';
}
}
}
?&gt;


the error like these:
=========================
---DATA---
HTTP/1.1 200 OK
Date: Mon, 12 May 2008 09:28:12 GMT
Server: Apache/2.2.4 (Win32) PHP/5.2.6
X-Powered-By: PHP/5.2.6
Content-Length: 370
Connection: close
Content-Type: text/xml

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
<methodResponse>
<fault>
<value>
<struct>
<member>
<name>faultCode</name>
<value><int>1</int></value>
</member>
<member>
<name>faultString</name>
<value><string>This is not a known method for this XML-RPC Server</string></value>
</member>
</struct>
</value>
</fault>
</methodResponse>
---END DATA---


---HEADERS---
HTTP/1.1 200 OK
Date: Mon, 12 May 2008 09:28:12 GMT
Server: Apache/2.2.4 (Win32) PHP/5.2.6
X-Powered-By: PHP/5.2.6
Content-Length: 370
Connection: close
Content-Type: text/xml
---END HEADERS---

---DATA---
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
<methodResponse>
<fault>
<value>
<struct>
<member>
<name>faultCode</name>
<value><int>1</int></value>
</member>
<member>
<name>faultString</name>
<value><string>This is not a known method for this XML-RPC Server</string></value>
</member>
</struct>
</value>
</fault>
</methodResponse>
---END DATA---

continue next topic,because the max character is 6000.
#2

[eluser]chmod[/eluser]
---PARSED---
object(XML_RPC_Values)#24 (29) {
["me"]=>
array(1) {
["struct"]=>
array(2) {
["faultCode"]=>
object(XML_RPC_Values)#22 (29) {
["me"]=>
array(1) {
["int"]=>
int(1)
}
["mytype"]=>
string(1) "1"
["debug"]=>
bool(false)
["xmlrpcI4"]=>
string(2) "i4"
["xmlrpcInt"]=>
string(3) "int"
["xmlrpcBoolean"]=>
string(7) "boolean"
["xmlrpcDouble"]=>
string(6) "double"
["xmlrpcString"]=>
string(6) "string"
["xmlrpcDateTime"]=>
string(16) "dateTime.iso8601"
["xmlrpcBase64"]=>
string(6) "base64"
["xmlrpcArray"]=>
string(5) "array"
["xmlrpcStruct"]=>
string(6) "struct"
["xmlrpcTypes"]=>
array(9) {
["i4"]=>
string(1) "1"
["int"]=>
string(1) "1"
["boolean"]=>
string(1) "1"
["string"]=>
string(1) "1"
["double"]=>
string(1) "1"
["dateTime.iso8601"]=>
string(1) "1"
["base64"]=>
string(1) "1"
["array"]=>
string(1) "2"
["struct"]=>
string(1) "3"
}
["valid_parents"]=>
array(17) {
["BOOLEAN"]=>
array(1) {
[0]=>
string(5) "VALUE"
}
["I4"]=>
array(1) {
[0]=>
string(5) "VALUE"
}
["INT"]=>
array(1) {
[0]=>
string(5) "VALUE"
}
["STRING"]=>
array(1) {
[0]=>
string(5) "VALUE"
}
["DOUBLE"]=>
array(1) {
[0]=>
string(5) "VALUE"
}
["DATETIME.ISO8601"]=>
array(1) {
[0]=>
string(5) "VALUE"
}
["BASE64"]=>
array(1) {
[0]=>
string(5) "VALUE"
}
["ARRAY"]=>
array(1) {
[0]=>
string(5) "VALUE"
}
["STRUCT"]=>
array(1) {
[0]=>
string(5) "VALUE"
}
["PARAM"]=>
array(1) {
[0]=>
string(6) "PARAMS"
}
["METHODNAME"]=>
array(1) {
[0]=>
string(10) "METHODCALL"
}
["PARAMS"]=>
array(2) {
[0]=>
string(10) "METHODCALL"
[1]=>
string(14) "METHODRESPONSE"
}
["MEMBER"]=>
array(1) {
[0]=>
string(6) "STRUCT"
}
["NAME"]=>
array(1) {
[0]=>
string(6) "MEMBER"
}
["DATA"]=>
array(1) {
[0]=>
string(5) "ARRAY"
}
["FAULT"]=>
array(1) {
[0]=>
string(14) "METHODRESPONSE"
}
["VALUE"]=>
array(4) {
[0]=>
string(6) "MEMBER"
[1]=>
string(4) "DATA"
[2]=>
string(5) "PARAM"
[3]=>
string(5) "FAULT"
}
}
["xmlrpcerr"]=>
array(6) {
["unknown_method"]=>
string(1) "1"
["invalid_return"]=>
string(1) "2"
["incorrect_params"]=>
string(1) "3"
["introspect_unknown"]=>
string(1) "4"
["http_error"]=>
string(1) "5"
["no_data"]=>
string(1) "6"
}
["xmlrpcstr"]=>
array(6) {
["unknown_method"]=>
string(50) "This is not a known method for this XML-RPC Server"
["invalid_return"]=>
string(133) "The XML data receieved was either invalid or not in the correct form for XML-RPC. Turn on debugging to examine the XML data further."
["incorrect_params"]=>
string(42) "Incorrect parameters were passed to method"
["introspect_unknown"]=>
string(52) "Cannot inspect signature for request: method unknown"
["http_error"]=>
string(55) "Did not receive a '200 OK' response from remote server."
["no_data"]=>
string(29) "No data received from server."
}

}
}
["faultString"]=>
object(XML_RPC_Values)#23 (29) {
["me"]=>
array(1) {
["string"]=>
string(50) "This is not a known method for this XML-RPC Server"
}
#3

[eluser]chmod[/eluser]
is there any errors in my code?I don't know what's wrong with it.
#4

[eluser]gtech[/eluser]
the line:
Code:
$this->xmlrpc->method('isconnect');
in your client

looks like it should be
Code:
$this->xmlrpc->method('Check_isconnect');

as this is the function mapping you have set up in the server..
($config['functions']['Check_isconnect'] = ....)

hope this helps.
#5

[eluser]chmod[/eluser]
o,i lost my mind.

thanks for you.
#6

[eluser]gtech[/eluser]
no probs.




Theme © iAndrew 2016 - Forum software by © MyBB