You need to sign in to do that
Don't have an account?
EJW
Flex API & Apex Code Web Services Issues
Running into a few issues with the Apex Flex library and Apex Code web services.
1) If you attempt to call an Apex web service via Connection.execute() that has no arguments you'll get one of several error messages back depending on how you attempt to call the web service. Is there a correct method for doing this with the latest Flex library? It currently won't allow you to pass a null, an empty array or an array containing a null as the argument list for the WS.
2) If you attempt to call an Apex web service that returns no results, you'll get a null value exception when the WS returns.
3) Exceptions thrown by Apex Code don't appear to be coming back to Flex in any manner. If Apex Code throws an exception the callback is never called and no Flex exception is thrown, so the application basically sits in limbo.
Has any one else experienced this? Are these known issues?
1) If you attempt to call an Apex web service via Connection.execute() that has no arguments you'll get one of several error messages back depending on how you attempt to call the web service. Is there a correct method for doing this with the latest Flex library? It currently won't allow you to pass a null, an empty array or an array containing a null as the argument list for the WS.
2) If you attempt to call an Apex web service that returns no results, you'll get a null value exception when the WS returns.
3) Exceptions thrown by Apex Code don't appear to be coming back to Flex in any manner. If Apex Code throws an exception the callback is never called and no Flex exception is thrown, so the application basically sits in limbo.
Has any one else experienced this? Are these known issues?
thanks for reporting this, we will try to release a new library soon after the Winter08 goes live on all servers.
you can see the unit tests in the directory test/FlexUni/Flex2/ExecuteTestCase.as
1) the call should work with a null array when no paramaters are expected by the webservice:
apex.execute("webServiceTest","testService",[],ar);
2) fixed by catching and returning null to your responder
3) i've created a test webservice that throws a null pointer exception, this is returned to the fault handler in the async responder, you can see this in the unit test.
The unit tests are checked in, the next build of the library will have these fixes, probably next week. If you need it sooner, you can build the srcs.
The code of my apex class are :
global class FlexWebService {
webservice static Integer getDouble (Integer x) {
Integer test = x * 2;
return test;
}
}
The AS code are:
var ar : AsyncResponder = new AsyncResponder(
function(result){
trace('Result Received'+result);
},
function(fault){
trace('Fault Received'+fault);
}
);
connection.execute("FlexWebService","getDouble",[1],ar);
The error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at com.salesforce::Connection/execute()[/Users/rhess/Documents/workspace/mavericks/sdk/src/com/salesforce/Connection.as:518]
Thanks.
Bruno.
Message Edited by Br1 on 10-08-2008 11:30 AM
Message Edited by Br1 on 10-08-2008 11:31 AM
Message Edited by Br1 on 10-08-2008 12:10 PM
Hi Ron,
Could you please look at the following and guide me in the right direction. I am badly stuck with this issue:
http://community.salesforce.com/t5/Apex-Code-Development/cannot-access-data-from-Apex-web-services/m-p/204523
any help would be greatly appreciated.
Thanks