all groups > macromedia flash flash remoting > september 2005 >
You're in the

macromedia flash flash remoting

group:

Flash 8 WebServiceconnector. Query.


Flash 8 WebServiceconnector. Query. Kerrdo
9/22/2005 12:00:00 AM
macromedia flash flash remoting:
I can connect my webservice fine. when working with strings i can extract the
data. But when my webservice returns a query i can't get any result besides
'undefined'.

My code.

import mx.data.components.WebServiceConnector;

var res:Function = function (evt:Object) {
trace(evt.target.results.items[0].description);
};

var wsProp:WebServiceConnector = new WebServiceConnector();
wsProp.WSDLURL =
"http://192.168.0.4:8500/ireps_interactive/wsProperty.cfc?wsdl";
wsProp.operation = "getProp";
wsProp.addEventListener("result", res);
wsProp.params = [1];
wsProp.suppressInvalidCalls = false;
wsProp.trigger();

If i view Debug > List Variables, i can see the description column and the row
contents, but how do i extract that data for use in actionscript.

TIA

Ricardo.
Re: Flash 8 WebServiceconnector. Query. Kerrdo
9/22/2005 6:15:18 AM
i didn't manage to get this to work, but i did get the RemotingConnector
working.

import mx.data.components.RemotingConnector;

var myRemConn_rc:RemotingConnector = new RemotingConnector();

// Setup Event Handlers for myRemConn
// Set Connector Properties
myRemConn_rc.addEventListener("result",propResult);
myRemConn_rc.addEventListener("status",propStatus);
myRemConn_rc.gatewayUrl = "http://localhost:8500/flashservices/gateway/";
myRemConn_rc.methodName = "getProp";
myRemConn_rc.serviceName = "ireps_interactive.wsProperty";
// myRemConn_rc.userId = "myUserID";
// myRemConn_rc.password = "myPassword";
myRemConn_rc.suppressInvalidCalls = true;
// Set Parameter Required by Remoting Service
myRemConn_rc.params = {propertyID:"1"};
// Trigger Connector
trace("Triggering myRemConn Now...");
myRemConn_rc.trigger();

function propResult(ev:Object) {
trace(ev.target.results.items[0].description);
}

function propStatus(stat:Object) {
trace(1);
trace("Categories Error - " + stat.code + " - " + stat.data.faultstring);
}

If anyone knows what was wrong with my code i would still like to know. i
would prefer to be building this with the web service instead of the remoting.

thanks
Ricardo.
Re: Flash 8 WebServiceconnector. Query. ELMICHA
9/25/2005 12:08:39 PM
Ricardo:
Copy the WSDL so that we can see what are you traing to do.


Saludos
ELMICHA
Re: Flash 8 WebServiceconnector. Query. ELMICHA
9/25/2005 12:13:54 PM
Ricardo:
The problem is here:
myRemConn_rc.addEventListener("result",propResult);

propResult is a function, and it has to be an Object.

try this,
var propResult:Object = new Object()
propResult.result = function(ev:Object) ///////// <------ result
will be the method called
{
trace(ev.target.results.items[0].description);
}

Saludos
ELMICHA
AddThis Social Bookmark Button