[wp-xmlrpc] XML RPC no response with flash lite?

M.S. forum at santosohome.com
Fri Sep 12 09:26:44 GMT 2008


hi everyone, this is my first post

i'm trying to develop flash lite client for wordpress blog, i've tried  
using xmlrpcflash by mattism @ sf.net but when put into mobile it  
gives out of memory error.

so i'm trying to re-write at first the metaWeblog.getRecentPosts but  
unsuccessful, hope i can get a solution. i haven't done programming  
for 8 years so i'm in beginner mode.

the xml is created as xml rpc spec but i got no XML response back. any  
idea why?

this is the trace output in flash (username and password replaced):

this is xmlcallstring:  
<methodCall><methodName>metaWeblog.getRecentPosts</ 
methodName><params><param><value><string>1</string></value></ 
param><param><value><string>username</string></value></ 
param><param><value><string>password</string></value></ 
param><param><value><int>20</int></value></param></params></methodCall>
FTPS033: A Call to loadVariables(http://santosohome.com/xmlrpc.php)  
found, limitations might apply.
Connected to http://santosohome.com:80/xmlrpc.php.
Sent data to http://santosohome.com:80/xmlrpc.php.
Loaded data from http://santosohome.com:80/xmlrpc.php.
Finished request for http://santosohome.com:80/xmlrpc.php.
This is onData
loaded: false
status: 0
this is the respond :


this is the code

var SERVICE_URL:String = "http://santosohome.com/xmlrpc.php";

var blog_id:String = "1";
var username:String = ""; //emptied for mail list
var password:String = ""; //emptied for mail list
var totalpost:String = "20";

var METHOD_NEW_POST:String = "metaWeblog.newPost";
var METHOD_EDIT_POST:String = "metaWeblog.editPost";
var METHOD_GET_POST:String = "metaWeblog.getPost";
var METHOD_GET_RECENT_POST:String = "metaWeblog.getRecentPosts";
var METHOD_GET_CATEGORIES:String = "metaWeblog.getCategories";
var METHOD_NEW_MEDIAOBJECT:String = "metaWeblog.newMediaObject";

var userDetail:Array = [
						[blog_id, "string"],
						[username, "string"],
						[password, "string"],
						[totalpost, "int"]
						];

var xmlCall:XML = new XML();
var xmlResponse:XML = new XML();
var ParentNode:XMLNode;
var ChildNode:XMLNode;

function createXML(args:Array) {
	ParentNode = xmlCall.createElement("methodCall");

	xmlCall.appendChild(ParentNode);
	
	ChildNode = xmlCall.createElement("methodName");
	ChildNode.appendChild(xmlCall.createTextNode(METHOD_GET_RECENT_POST));
	ParentNode.appendChild(ChildNode);
	
	ChildNode = xmlCall.createElement("params");
	ParentNode.appendChild(ChildNode);
	ParentNode = ChildNode;
	
	createParams(args);
}

function createParams(args:Array) {
	for (i=0; i < args.length; i++) {
		ChildNode = xmlCall.createElement("param");
		var Node:XMLNode = xmlCall.createElement("value");
		ChildNode.appendChild(Node);
		var NodeType:XMLNode = xmlCall.createElement(args[i][1]);
		Node.appendChild(NodeType);
		NodeType.appendChild(xmlCall.createTextNode(args[i][0]));
		
		ParentNode.appendChild(ChildNode);
	}
	
	var xmlCallString:String = xmlCall.toString();
	
	trace("this is xmlcallstring: " + xmlCallString);
	
	var x:XML = new XML();
	x.ignoreWhite = true;
	x.xmlDecl = '<?xml version="1.0"?>';
	x.contentType = "text/xml";
	x.parseXML( xmlCallString );
	
	x.sendAndLoad(SERVICE_URL, xmlResponse);
	
}

createXML(userDetail);

xmlResponse.onLoad = function () {
	myText.text = xmlResponse.toString();
	trace("this is onLoad");
	trace("loaded: " + xmlResponse.loaded);
	trace("status: " + xmlResponse.status);
	trace("this is the respond : " + xmlResponse);
}

xmlResponse.onData = function () {
	myText.text = xmlResponse.toString();
	trace("This is onData");
	trace("loaded: " + xmlResponse.loaded);
	trace("status: " + xmlResponse.status);
	trace("this is the respond : " + xmlResponse);
}


More information about the wp-xmlrpc mailing list