Last post Jan 14, 2015 05:26 PM by AidyF
Jan 14, 2015 04:41 PM|jnet222|LINK
I'm just adding a super simple web service. Just a stock quote from an example site http://www.webservicex.net/stockquote.asmx?op=GetQuote the web reference is added fine.
This is my snippet of code and when I run the page is gives me an error Type 'stockTest.StockQuoteSoapClient' is not defined.
Dim test As New stockTest.StockQuoteSoapClient()
testcaal = test.GetQuote("mmm")
Label2.Text = testcaal
Can someone tell me why I'm getting this error?
Jan 14, 2015 05:26 PM|AidyF|LINK
If you google "add asmx service to visual studio" you'll find a list of steps to take to add a reference. Right-click the project in Solution Explorer -> Add Service Reference -> Advanced -> Add Web Reference, put the address to the asmx file in the bar
and click the go button. When the service is found, enter "stockTest" in the "Web reference name" box, and now you can write this
stockTest.StockQuote client = new stockTest.StockQuote();
string q = client.GetQuote("ntl");