Publishing web service

  • Thread starter Thread starter cj
  • Start date Start date
C

cj

I'm finally back to trying to write a web service. In VB 2005 I created
a new web site and then ASP.NET Web Service. It opened showing
App_Code/Service.VB with the following code already in it

Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols

<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class Service
Inherits System.Web.Services.WebService

<WebMethod()> _
Public Function HelloWorld() As String
Return "Hello World"
End Function

End Class

This is a fine starting point. How do I test this? We have a web
server here but I need some steps to compile and put it on the web
server. I've only written windows apps so far. I can write a test
program to use the web service.

Also in my investigation of web services I thought this code was
supposed to be in service.asmx. The only thing in service.asmx is

<%@ WebService Language="vb" CodeBehind="~/App_Code/Service.vb"
Class="Service" %>

What's up with that?
 
cj,

A webservice is in fact a website, you have to set the IIS for that. Have a
look as it is now on your testing computer and use it on the production
server.

Cor
 
Our production server is currently running and hosting other pages.
What I need to know is what and how do I move a project from the Visual
Studio IDE to the web server.
 
Hi Cj,

For ASP.NET/VS 2005 webservice, if you just want to test or debug it, you
can just run it in VS 2005(through the test webserver) and use other client
project to call it. To call webservice, you should generated the webservice
client proxy first. The "Add WebReference" function in VS 2005 can help you
do it:

#How to: Add and Remove Web References
http://msdn2.microsoft.com/en-us/library/d9w023sx(VS.80).aspx

for deploying webservice project to IIS, it is the same as deploying an
ASP.NET web application. You can use the VS 2005 built-in features such as
"Publish Web Site" or "Copy Web Site". You can find "Copy Web Site" menu in
the "WebSite" menu and find "Publish WEb Site" in the "Build" menu(in case
you're currently in a web project). Here are some MSDN reference mentioend
the web application deployment:

#Web Site Deployment in Visual Web Developer
http://msdn2.microsoft.com/en-us/library/5c12ykae(VS.80).aspx

#Walkthrough: Creating an XML Web Service Using Visual Basic or Visual C#
http://msdn2.microsoft.com/en-us/library/87h5xz7x(VS.80).aspx

Or you can also do all the stuffs yourself.

** create the virutal directory(mark it as application and set it to the
proper ASP.NET version)

** copy all the webservice project content into it

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.




--------------------
 
Thanks
Hi Cj,

For ASP.NET/VS 2005 webservice, if you just want to test or debug it, you
can just run it in VS 2005(through the test webserver) and use other client
project to call it. To call webservice, you should generated the webservice
client proxy first. The "Add WebReference" function in VS 2005 can help you
do it:

#How to: Add and Remove Web References
http://msdn2.microsoft.com/en-us/library/d9w023sx(VS.80).aspx

for deploying webservice project to IIS, it is the same as deploying an
ASP.NET web application. You can use the VS 2005 built-in features such as
"Publish Web Site" or "Copy Web Site". You can find "Copy Web Site" menu in
the "WebSite" menu and find "Publish WEb Site" in the "Build" menu(in case
you're currently in a web project). Here are some MSDN reference mentioend
the web application deployment:

#Web Site Deployment in Visual Web Developer
http://msdn2.microsoft.com/en-us/library/5c12ykae(VS.80).aspx

#Walkthrough: Creating an XML Web Service Using Visual Basic or Visual C#
http://msdn2.microsoft.com/en-us/library/87h5xz7x(VS.80).aspx

Or you can also do all the stuffs yourself.

** create the virutal directory(mark it as application and set it to the
proper ASP.NET version)

** copy all the webservice project content into it

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.
 
Back
Top