I'm trying to connect a Flash interface with a web service over the company
intranet, and so far having no luck at all. While I have a pretty good Flash
background, my experience with other web technologies is pretty limited. The
web service, which spits back XML, has been put together by a web developer who
doesn't have a lot of experience with Flash. I'm using a web service object to
connect, and the URL he has given me to connect to looks like this:
http://usdev.somedomain.com/PrintWebService/printwebservice.asmx?op=FindAllOffic
esXML
As I understand it,
"http://usdev.somedomain.com/PrintWebService/printwebservice.asmx" is the web
service itself and "FindAllOfficesXML" is the web service method.
But that URL doesn't make sense in the context of my code:
import mx.services.WebService;
import mx.services.PendingCall;
connectto_ws();
function connectto_ws() {
datapath =
"http://usdev.somedomain.com/PrintWebService/printwebservice.asmx?op=FindAllOffi
cesXML";
printwebservice = new WebService(datapath);
pendingcall = printwebservice.FindAllOfficesXML();
pendingcall.onResult = function(result) {
_root.resultstring.text = result;
};
pendingcall.onFault = function(fault) {
_root.resultstring.text = fault.faultstring;
};
}
I'm setting the web service URL to the specific method, FindAllOfficesXML, of
the web service, and then I'm defining pendingcall as a method of that same
method!
Changing the URL to more closely resemble examples I see online doesn't work
either:
http://usdev.somedomain.com/PrintWebService/printwebservice.asmx?wsdl
I have a feeling the solution is pretty simple, but I'm not seeing it.
import mx.services.WebService;
import mx.services.PendingCall;
connectto_ws();
function connectto_ws() {
datapath =
"http://usdev.somedomain.com/PrintWebService/printwebservice.asmx?op=FindAllOffi
cesXML";
printwebservice = new WebService(datapath);
pendingcall = printwebservice.FindAllOfficesXML();
pendingcall.onResult = function(result) {
_root.resultstring.text = result;
};
pendingcall.onFault = function(fault) {
_root.resultstring.text = fault.faultstring;
};
}
NIlesh@ADOBE - 21 Jul 2008 14:15 GMT
Hello billgregg,
As per my info the path (datapath in your case) should the path to WSDL, which
contains the operation to perform on the service. I am also not sure as I
havent tried much on this.
However few helps pointers are below.
printwebservice .onLoad = function(wsdl:Object){
fn1("5"); //5 is sample argument
};
and your f1 should contain the code which check the result of pending call
like what you have written pendingcall = printwebservice.FindAllOfficesXML();
pendingcall.onResult = function(result) {
_root.resultstring.text = result;
};
This is as per my info.
Hope this helps
Regards,
Nilesh Walkoli