having problems with webservice (proxy) reference

P

phil2phil

hi,
i was working on a book sample, book showed how to connect to a
webservice using Vs.Net (web-reference) and another way to do withou
vs. i got the vs working but the other way isn't. I build the proper
dll using the wsdl command, and added the generated dll to my bin. i
then use the object but keep getting reference errors:

this is the generated code (wsdl tool made):
.....
public class StockTicker :
System.Web.Services.Protocols.SoapHttpClientProtocol {
/// <remarks/>
public StockTicker() {
....

i just want to use that object (note the default namespace was Wsdl)

now in my aspx page, i have this:
....
using Wsdl.StockTicker;
namespace ServiceTest
{
public class WebForm1 : System.Web.UI.Page
{
StockTicker proxy = new StockTicker();
....

problem is it can't locate the StockTicker object, i tried adding the
using Wsdl.StockTicker line but still the same error:
Compiler Error Message: CS0246: The type or namespace name
'StockTicker' could not be found (are you missing a using directive or
an assembly reference?)

the dll is there in the project bin, any ideas?
 
A

ArunPrakash

Actually, when you add a web reference, there is a name suggested.
Usually its 'localhost' if you are adding the web service from the
local server. You have to include the namespace in your client code. Or
the instantiation line in your code can be
localhost.StockTicker proxy = new localhost.StockTicker();

p.s. You can change the default name to any name you want and that
becomes the namespace of the generated proxy.

Hope this helps
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top