Just another tech site

ActionScript 2.0 : WebService


This is a just a simple code that calls a webservice.

import mx.services.*; 
var _wsdl:String = "https://www.test.com/testservice.asmx?WSDL";

var MailService:WebService = new WebService(_wsdl);
MailService.onLoad = function()
{
	trace("Trace Wsdl loaded");
  	var MailServiceResult:PendingCall = MailService.WEBMETHODNAME("value1","value2",1,1); 
  	MailServiceResult.onFault = function(fault)
  	{
    	        trace("FAULT!  " + fault.faultstring);
  	}
  	MailServiceResult.onResult = function(result)
  	{
    	         trace("it works!");
  	}  
} 
MailService.onFault = function(fault)
{
    // Your code here.
	trace("WSDL FAULT!  " + fault.faultstring);
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Tag Cloud

%d bloggers like this: