Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/315.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# JSON.NETASMX和Flex3_C#_.net_Apache Flex_Json_Asmx - Fatal编程技术网

C# JSON.NETASMX和Flex3

C# JSON.NETASMX和Flex3,c#,.net,apache-flex,json,asmx,C#,.net,Apache Flex,Json,Asmx,我在.net中编写了返回json字符串的webservice WebService(Namespace = "AndrewRowland")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [ScriptService] public class Service1 : System.Web.Services.WebService { [WebMethod] [ScriptMethod(Response

我在.net中编写了返回json字符串的webservice

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);

    }
}
现在我想在Flex3中使用这个方法“HelloWorld”,但我不知道如何询问这个方法,我所做的是将corelib放入我的libs并编写httpService:

:


我不太了解.NET。但是,如果要调用soapweb服务,请使用标记而不是HTTPService。使用WebService,您可以调用WSDL上的特定方法,有点像这样:

service.HelloWorld(); 
你应该通读全文以了解更多细节

<mx:HTTPService id="service" resultFormat="text"
                url="http://localhost:50174/Service1.asmxn"
                result="onJSONLoad(event)" />
service.HelloWorld();