C# Asp.Net Webservice:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Web;
using System.Web.Services;
namespace Director
{
public class Hello : System.Web.Services.WebService
{
public Hello() {
InitializeComponent();
}
#region Component Designer generated code
private IContainer components = null;
private void InitializeComponent() { }
protected override void Dispose( bool disposing ) {
if(disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing); }
#endregion
[WebMethod]
public string HelloWorld(string variable) {
return "Hello " + variable;
}
}
}
MXML Application:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:WebService id="myService"
wsdl="http://localhost/Director/Hello.asmx?WSDL"
load="myService.HelloWorld('Peter')"
showBusyCursor="true"/>
<mx:Label text="{myService.HelloWorld.lastResult}"/>
</mx:Application>
If you're not accessing a webservice on the same machine don't forget your crossdomain.xml file in your IIS webroot folder:
<?xml version="1.0"?>
<!-- http://www.foo.com/crossdomain.xml -->
<cross-domain-policy>
<allow-access-from domain="*"/>
</cross-domain-policy>
__._,_.___
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
Software development tool | Software development | Software development services |
Home design software | Software development company |
Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe
__,_._,___