0
我写的web服务在.NET其返回JSON字符串JSON .NET ASMX和Flex3
WebService(Namespace = "AndrewRowland")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ScriptService]
public class Service1 : System.Web.Services.WebService
{
[WebMethod]
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public string HelloWorld()
{
test Test = new test();
Test.a = "one";
Test.b = "two";
JavaScriptSerializer js = new JavaScriptSerializer();
return js.Serialize(Test);
}
}
,现在我想在cosume这Flex3方法“的HelloWorld”,但我不知道怎么问这个梅托德什么,我所做的就是把corelib的到我的库和HTTPService在写道:
:
private function onJSONLoad(event:ResultEvent):void
{
var rawData:String = String(event.result);
var manager = JSON.decode(rawData);
}
<mx:HTTPService id="service" resultFormat="text"
url="http://localhost:50174/Service1.asmxn"
result="onJSONLoad(event)" />