简体   繁体   中英

ASMX web service not generating async functions

I made ac# web service (new website > asp.net web service) with 1 function that was auto generated :

[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
[System.Web.Script.Services.ScriptService]
public class MyService : System.Web.Services.WebService
{

    [WebMethod]
    public string Hello()
    {
        return "Hello User";
    }
}

I also made a winform app and added a reference to that service and tried to call HelloWorldAsynch but all I had was HelloWorld

new ServiceReference1.Service1SoapClient().HelloWorldAsynch?

Does anyone know why is this happening?

It seems the problem is that I added the web service as a service reference and not as a web reference

Fix : http://msdn.microsoft.com/en-us/library/bb628649.aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM