Ultrashock Forums > Flash > Data Communication
Access a webservice using Loadvars

You are currently viewing our website as a guest which gives you limited access to forums, files and other resources.

Click here to join now for free, and start interacting with our members, download files and much more!

Click here if you are looking for our Flash files and other professional assets.
 
Post Reply | View first unread | Rate Thread Search this Thread | Thread Tools | Display Modes

#1
Bookmark and Share!
Access a webservice using Loadvars
Old 2008-03-13

I'm attempting to access a webservice using Loadvars but I can't seem to format the parameters. I have:

Code:
WSDLURL = "http:///www.somewsdl.wsdl"
methodname= "doSomething"
var props : Array = new Array
props [0] = "red";
props [1] = "white";
props [2] = "blue";

webRequest.sendAndLoad(WSDLURL+methodName+props, webResponse, "post");
Can anyone help?
postbit arrow 5 comments | 1581 views postbit arrow Reply: with Quote   
Registered User
bob_300 is offline
seperator
Posts: 71
2008-01-20
seperator

Ultrashock Member Comments:
SightStorm's Avatar SightStorm SightStorm is offline SightStorm lives in United States 2008-03-13 #2 Old  
I'm not sure if you can do webservices with sendAndLoad. I've always used the web services class:

ActionScript Code:
  1. import mx.services.*;
  2. var myService = new WebService("your.svc?wsdl",serviceLog);
  3. var resultObject = myService.method(object,param,array); //whatever params/object/array you need to pass
  4. resultObject.onLoad = trace("Loading Service");
  5.     myResultLead.onResult = function(result) {
  6.         trace(result);
  7.     }
  8.     myResultLead.onFault = function(fault) {
  9.         trace("Failed! WTF")
  10.     }
  11. serviceLog= new Log(Log.DEBUG);
  12. serviceLog.onLog = function(txt) {
  13.    //trace(txt); //helps you on whats going on
  14. }

Good luck.
Reply With Quote  
bob_300 bob_300 is offline 2008-03-14 #3 Old  
Hi,Thanks.

Is there any way of caching the WSDL so that it is in memory? At the moment it has to be loaded and parsed each time a new service is called.
Reply With Quote  
SightStorm's Avatar SightStorm SightStorm is offline SightStorm lives in United States 2008-03-14 #4 Old  
Haha that i do not know. If someone does have a solution to that I would be more than happy to listen And boy have i looked around
Reply With Quote  
murst murst is offline 2008-08-27 #5 Old  
I'm not sure if you can do webservices with sendAndLoad.
Here is a tutorial on how to use sendAndLoad with webservices.
Reply With Quote  
Thread Tools
Display Modes Rate This Thread
Rate This Thread: