How to use web.config, asmx and default.aspx

I am having a problem getting my DEFAULT.ASPX file to get the connection in the WEB.CONFIG file, which is calling on a webservice asmx located on a website server. Below are my settings in the web.config file and the default.aspx file.

Notes:
1. I hand coded these files, so there are no other files in play.
2. When I use Visual Studio 2005, there are lots of other files. However, when I copy the files to my website server, I encounter other issues. I cannot use the 'publish' feature in VS2005. I am just trying to run a test to see how the ASMX file works. In this case, the ASMX file is returning a dataset, which the default.aspx file will display to the user.

Questions:
1. What am I doing wrong?
2. Does the asmx file, or something else need to be compiled before I upload it to my server?
3. Where is the location of the web.config file? Can it be in the sub-folder where default.aspx is or does it need to be in the website root folder?

[web.config]
<configuration>
<appSettings>
<add key="ABC.Test" value="http://www.mywebsitee.com//WebServices/Test.asmx"/>
</appSettings>

[default.aspx]
Sub gv_Clients_Load()
    Dim ws As New ABC.Test      <---- Error here, see msg below
    gv_Clients.DataSource = ws.GetClients
    gv_Clients.DataBind()
End Sub

[default.aspx      Error Message]
Compiler Error Message: BC30002: Type 'ABC.Test' is not defined.


MikeCombeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

strickddCommented:
To call a web service, you need a proxy class of some sort. To easily do this, you should add a web reference to that web service URL you posted. Then you can instantiate an object of that type as you have in your code.

On another not, to reference something in the web.config appSettings section, it is like this:

System.Configuration.ConfigurationManager.AppSettings["ABC.Test"]
0
MikeCombeAuthor Commented:
>>>>>>>>>>>>>>>>>>>>>>>>>>
To easily do this, you should add a web reference to that web service URL you posted.
<<<<<<<<<<<<<<<<<<<<<<<<<<

How do I do this ?
0
MikeCombeAuthor Commented:
>>>>>>>>>>>>>>>>>>>>>>>>>>
On another not, to reference something in the web.config appSettings section, it is like this:
System.Configuration.ConfigurationManager.AppSettings["ABC.Test"]
<<<<<<<<<<<<<<<<<<<<<<<<<<

changing......

[default.aspx]
Sub gv_Clients_Load()
    dim ws as New System.Configuration.ConfigurationManager.AppSettings("ABC.Test")
    gv_Clients.DataSource = ws.GetClients
    gv_Clients.DataBind()
End Sub

error;;;;;;

Compiler Error Message: BC30002: Type 'System.Configuration.ConfigurationManager.AppSettings' is not defined.
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

strickddCommented:
If you right click on your project or website and Add Web Reference, follow the wizard, and VS will create the proxy class. Make sure to call the web reference ABC.Test and your code will then look like:

dim ws as New ABC.Text()

The "System.Configuration.ConfigurationManager.AppSettings("ABC.Test")" line of code was merely to show you how to reference a value from the appSettings, you cannot instantiate and object from a string key.
0
MikeCombeAuthor Commented:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
If you right click on your project or website and Add Web Reference, follow the wizard, and VS will create the proxy class. Make sure to call the web reference ABC.Test and your code will then look like:
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

I understand what you are saying......but I don't want to use VS to build my project.
I am trying to find the code that I need to run my asmx file.
I should be able to hand-code without VS.
0
strickddCommented:
Is there a reason for not using VS? Licensing? Operating system? What?

If you want to call the web service then, you will need to create your own proxy class to call the web service and interact with it that way. If you can use other tools to create the proxy, you can follow the first half of this: http://msdn.microsoft.com/en-us/library/ms155134.aspx.

Other than that, you can create the XML manually through string builders and post that directly to the server, but you lose all the typed objects/properties and have to parse the XML return manually.

What exactly are you trying to achieve?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
WCF

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.