473,405 Members | 2,167 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Webservice sample for VS2005

Hello,
I'm trying to figure out how to reference a web service from a
VS2005 web site project. I know how to do this in VS2003.

I've been combing msdn for samples, but I've only found the
MovieCollection app,
which is a windows app, and doesn't compile for me.

If anybody can point me to a sample I'd appreciate it.

TIA,
Jim

Nov 19 '05 #1
6 1577
Right-click on the project itself in the Solution Explorer for the context
menu, or click the Project menu item up top, select Add Web Reference, and
the rest is the same.

<jh*****@yahoo.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Hello,
I'm trying to figure out how to reference a web service from a
VS2005 web site project. I know how to do this in VS2003.

I've been combing msdn for samples, but I've only found the
MovieCollection app,
which is a windows app, and doesn't compile for me.

If anybody can point me to a sample I'd appreciate it.

TIA,
Jim

Nov 19 '05 #2
I can do that much, but to me it's not the same after that.

In VS2003 I can then add the webservice namespace, i.e
I type:
using myProject.

At this point the web service I've added pops up in intellisense.
Then I can go ahead and write code using the methods from the web
service.

In VS2005 I can't figure out how to add the namespace or how to get
references to the methods.

Example: Instead of having a project called "myProject", I now have a
web site called "http:localhost/myProject". I've added a web reference
to "mySevice", but I can't figure out how to use these in the code.

Nov 19 '05 #3
So after you successfully added the Web reference, and if you used the
default name that VS supplies when adding the Web reference - namely
localhost, you should be able to declare it
Dim MyService as localhost.Service1 = new localhost.Service1
and intellisense should be there, it works for me.

Did you use VS2005 to write the Web service? The reason I am asking is that
you might have created a File System Web Site rather than a Local IIS Web
Site. In this case I don't think you would be able to add a Web reference to
the client project though.
<jh*****@yahoo.com> wrote in message
news:11*********************@o13g2000cwo.googlegro ups.com...
I can do that much, but to me it's not the same after that.

In VS2003 I can then add the webservice namespace, i.e
I type:
using myProject.

At this point the web service I've added pops up in intellisense.
Then I can go ahead and write code using the methods from the web
service.

In VS2005 I can't figure out how to add the namespace or how to get
references to the methods.

Example: Instead of having a project called "myProject", I now have a
web site called "http:localhost/myProject". I've added a web reference
to "mySevice", but I can't figure out how to use these in the code.

Nov 19 '05 #4
Chris,
Thanks for your replies.

What I actually have in the project is a folder called
App_WebReferences.
Underneath that is "2ksqldev4" (what I referred to . This is a server
that has MS Reporting Services installed, and it includes a webservice
that I can consume from VS2003.
Following your example, in C#, I should be able to declare a variable
like
2ksqldev4.Service1 myService = new 2ksqldev4.Service1();
but this does not work.
I can try it from VB.

Nov 19 '05 #5
What happens if you go "Project" then "Add Web Reference".
The wizard comes up, click "Web services on the local machine".
It will do it's thing and display a list. You say you are adding a Web
reference to Report Server - incidentally this service is called
"ReportServer" as well, find it in the list and click on it.
On the right hand side, maybe give it a better name, change "localhost" to
something like "MSRepSrvr" and click Add Reference.
In your app then use it like
MSRepSrvr.ReportingService theSrvice = new MSRepSrvr.ReportingService();
Intellisense should be there, it should not have anything to do with VB.

<jh*****@yahoo.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Chris,
Thanks for your replies.

What I actually have in the project is a folder called
App_WebReferences.
Underneath that is "2ksqldev4" (what I referred to . This is a server
that has MS Reporting Services installed, and it includes a webservice
that I can consume from VS2003.
Following your example, in C#, I should be able to declare a variable
like
2ksqldev4.Service1 myService = new 2ksqldev4.Service1();
but this does not work.
I can try it from VB.

Nov 19 '05 #6
Well, that was interesting. I renamed it, similar to your suggestion,
and it works. Change it back and it doesn't. Evidently having a name
that starts with a number is illegal.
Thanks for working through this.

Nov 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: hawkeye.parker | last post by:
using .net 1.1 i think i might want to replace the xml serializer which my .Net webservice uses with a custom serializer. anyone know: a) is this possible? b) if so, is it terribly difficult...
8
by: Maxi | last post by:
Hello, i'm sorry my bad english :( I have CR9 Webservice, how to change databadse name and User_name into Webservice method? (not Viewer Control) Tks!! -- --------------------------
4
by: Craig | last post by:
Hi All, Not too long ago, I posted a question about any known issues of a VS2005 application calling a VS2003 web service. We narrowed it down to an issue with VS2005. If our customer runs...
2
by: Franklin M. Gauer III | last post by:
I create a simple DATAADAPTER in a webservice project. It creates the UPDATE, INSERT, DELETE commands for me - no problem. In vS2005 it creates these commands as RESOURCES in the RESX file (i.e....
0
by: Eric bouxirot | last post by:
hi, i have some trouble to debug my webservice i have a server with SBS2003 (with domain controler) with IIS 6 my dev machine is XP Pro on WorkGroup with VS2005 if i run webservice and...
4
by: =?Utf-8?B?TmFkYXYgUG9wcGxld2VsbA==?= | last post by:
Hi everybody, I've got two questions about using the EnableSession property with an ASP.NET WebService: First Question: I'm trying to create a web service with EnableSession=true. I can't...
0
by: =?Utf-8?B?VmlsaGVsbQ==?= | last post by:
Using .NET 2.0 and VS2005, I am trying to make a simple WebService application and an installer for it. I want to distribute the installer to several customers, so the installation should run as...
2
by: =?Utf-8?B?TGFycnlLdXBlcm1hbg==?= | last post by:
Our WebDev team seems to have found a problem that exposes a bug in .NET 2.0. This problem can be shown when trying to access a WebService using SSL and through a proxy server after using the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.