问题描述
IwrotethehelloworldwebserviceinC#byVisualStudio,however,Ihitseveraltrouble,finallyIresolvedthemby2hours.Tobuildawebserviceiseasy,thewebservicelookslikethis:thenhereishowtousethewebservicebyvisualstudio.Invisualstudio,firstyouneedgotosolutionwindow--->webreference,rightclickonit,--->addwebreferenceAdialogwindowpopsup,youneedinput"http://shiny:89/Service1.asmx"hitgobuttonwebreferencenameisanynameyoudecided.shinyequalslocalhost,shinyismycomputername.Inyoursourcecode,howtoreferthiswebservice,seebelowinred,addsvciswebreferencename,Service1isrealservicename,donotconfusethetwoguys.Service1issameasinbrowser,protectedvoidrunSrvice_Click(Objectsender,EventArgse){addsvc.Service1mySvc=newaddsvc.Service1();Label1.Text=mySvc.HelloWorld();Label2.Text=mySvc.Add(Int32.Parse(txtNum1.Text),Int32.Parse(txtNum2.Text)).ToString();}
解决方案
解决方案二:
不明LZ在说什么
解决方案三:
支持搂主,收藏