I have Livecycle ES installed on an application server (not the machine I'm calling from). I have Flex 3 installed on my machine. I'm coding up a custom-built Form Guide. I'm trying to call a process on the Livecycle ES machine with mx.rpc.soap.WebService using ActionScript. I was able to get it working with just one parameter, but now that I have many parameters it's puking on me. I have tested the process by invoking from Workspace and it behaves as expected. When I try it from the formguide/Flex AS I get an IO error. Here's the pertinent code snippet:
import mx.controls.Alert;
import mx.events.FlexEvent;
import mx.rpc.events.FaultEvent;
import mx.rpc.soap.LoadEvent;
import mx.rpc.soap.Operation;
import mx.rpc.soap.WebService;
import xfamx.scripting.Xfa;
import xfamx.utils.XMLUtils;
private var stateService:WebService;
private var _webServiceLoaded:Boolean = false; // flag noting when wsdl has been loaded
private function initWebService():void {
if (!stateService) {
stateService = new WebService();
stateService.wsdl = "
http://xxx.xxx.xxx:8080/soap/services/SaveState?wsdl"; // replace this url
stateService.addEventListe
ner(LoadEv
ent.LOAD, load_listener);
stateService.addEventListe
ner(FaultE
vent.FAULT
, fault_listener);
stateService.loadWSDL();
mx.controls.Alert.show('In
itializing
WSDL', 'Message');
}
}
private function saveState():void {
initWebService(); // init webservice
if (_webServiceLoaded) { // is wsdl is loaded
//stateService.setRemoteCr
edentials(
"user", "password"); -- This doesn't seem to work anyway.
var xmlModel:XML = new XML(Xfa.instance.datasets.
saveXML())
;
stateService.invoke.send('
00000000-0
000-0000-0
000-000000
000000',fa
lse,'',xml
Model..dat
a,'asdf',f
alse,'asdf
');
mx.controls.Alert.show('St
ate Sent!', 'Message'); // Comment this out later.
} else { // else
callLater(saveState); // wait a frame and try again
}
}
public function fault_listener(event:Fault
Event):voi
d {
mx.controls.Alert.show(eve
nt.fault.m
essage, 'Message');
mx.controls.Alert.show(eve
nt.fault.r
ootCause.t
oString(),
'Root Cause toString');
mx.controls.Alert.show(eve
nt.fault.t
oString(),
'fault toString');
}
public function load_listener(event:LoadEv
ent):void {
_webServiceLoaded = true; // mark wsdl as loaded so we know we can use the web service
mx.controls.Alert.show('In
itialized'
, 'Message');
}
Generates the following error:
Fault toString:
[RPC Fault faultString="HTTP request error" faultCode="Server.Error.Re
quest" faultDetail="Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL:
http://xxx.xxx.xxx:8080/soap/services/SaveState"]. URL:
http://xxx.xxx.xxx:8080/soap/services/SaveState"]
Root Cause toString:
[IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL:
http://xxx.xxx.xxx:8080/soap/services/SaveState"]
When I watch the transaction with Wireshark (PKA ethereal) I see the data send up base64 encoded, and then a 500 error coming back from the server. So, I assume that I'm not sending the parameters correctly. But I can't find anything about the correct formatting for sending multiple parameters to a LC ES Process using Flex 2 and ActionScript. I don't want the mxml equivalent, I want the actionscript method.
I've already read the Adobe docs:
http://livedocs.adobe.com/flex/201/langref/mx/rpc/soap/WebService.html to no avail.
If there is a Flex expert out there, please help. TYIA
Start Free Trial