NetJavaScriptFlex
一、建立webservice
using System;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消对下行的注释。
// [System.Web.Script.Services.ScriptService]
public class Service : System.Web.Services.WebService
{
public Service () {
//如果使用设计的组件,请取消注释以下行
//InitializeComponent();
}
[WebMethod]
public string HelloWorld() {
return "Hello World";
}
[WebMethod]
public double Calc(double r)
{
return 2 * r * Math.PI;
}
}
二、Flex Bulider中
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
private function calc():void
{
var l:Number;
l=Number(radius.text)*2*Math.PI;
grith.text=String(l);
}
]]>
</mx:Script>
<mx:WebService id="calcService" wsdl="http://localhost:12374/Test1/Service.asmx?WSDL" useProxy="false">
<mx:operation name="Calc">
<mx:request>
<r>{radius.text}</r>
</mx:request>
</mx:operation>
</mx:WebService>
<mx:Button x="390" y="161" label="Button" click="calc();"/>
<mx:TextInput x="213" y="161" id="radius"/>
<mx:Text x="213" y="215" text="圆周长:"/>
<mx:Text x="251" y="215" text="{calcService.Calc.lastResult}" id="grith"/>
<mx:Button x="493" y="161" label="NET互操作" click="calcService.Calc.send();"/>
</mx:Application>
转载于:https://www.cnblogs.com/yidianfeng/archive/2011/10/24/2222878.html
NetJavaScriptFlex相关推荐
最新文章
- 98页PPT,看懂阿里、小米、京东、美团的组织架构和战略变迁!
- 【mysql优化专题】本专题终极总结(共12篇)
- Junit 测试之 Spring Test
- css hot loader,解决安装react-hot-loader后修改css/less文件不会热更新问题
- Page_Load Page_Init方法使用原理(转)
- c++ 中的 cin.get()函数
- WebRTC第六步:下载webrtc
- 海浪 shader_海浪下的发现
- AdaBoost 算法 入门
- jq之$(“p:first“)
- Qt学习笔记-QSS装饰控件
- oom 如何避免 高并发_如何设计这样一个高并发系统?
- 蚂蚁的开放:想办法摸到10米的篮筐
- linux suse 安装redis,redis 集群安装问题 【SUSE Linux Enterprise Server 11 SP3】
- mysql允许虚拟机访问权限_设置虚拟机安装的mysql访问权限及删除mysql
- animate将flash转换html,Animate—flash动画入门到精通教程
- make settings时编译报错:dalvik/dx/bin/Android.bp:24:1: module “dx-doc-stubs“ already defined
- 不需要再手写 onSaveInstanceState 了,因为你的时间非常值钱
- 使用百度地图API来完成交大校园巴士时刻表
- 【笔试题目整理】 网易2018校园招聘数据分析工程师笔试卷