How to Create and Test the WebService ?

E

ElanKathir

Hi

How to Create the WebService and How to test the it ?


I paste the Code here,

In that Code, What is Role of NameSapce? The NameSapce ref the http://tempuri.org/, Why?

How to Call the Method HelloWorld ?

Imports System.Web.Services

<WebService(Namespace := "http://tempuri.org/")> _

Public Class Service1

Inherits System.Web.Services.WebService

#Region " Web Services Designer Generated Code "

Public Sub New()

MyBase.New()

'This call is required by the Web Services Designer.

InitializeComponent()

'Add your own initialization code after the InitializeComponent() call

End Sub

'Required by the Web Services Designer

Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Web Services Designer

'It can be modified using the Web Services Designer.

'Do not modify it using the code editor.

<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

End Sub

Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)

'CODEGEN: This procedure is required by the Web Services Designer

'Do not modify it using the code editor.

If disposing Then

If Not (components Is Nothing) Then

components.Dispose()

End If

End If

MyBase.Dispose(disposing)

End Sub

#End Region

' WEB SERVICE EXAMPLE

' The HelloWorld() example service returns the string Hello World.

' To build, uncomment the following lines then save and build the project.

' To test this web service, ensure that the .asmx file is the start page

' and press F5.

'

<WebMethod()> Public Function HelloWorld() As String

HelloWorld = "Hello World"

End Function

End Class



Thanks & Regards,
Elankathir,
ASM Technologies,
B'lore.
 
W

William Ryan eMVP

Tempuri.org is put in their by default and it's recommended that you use your own url or provide one explicitly -- you may want to check out http://tempuri.org this link, it's describes it in depth.

As far as testing it...you can compile and build it and press the Invoke button in the web form that pops up. You can debug just as you normally would. The other method is to build a stub program to test with and simply add a web reference pointing to the url that the Web Service exists at. Then you declare a new instance of the class and use it just like you would a class sitting in a .dll or other project. Other than setting it as a web reference, the process of using it is virtually identical.
Hi

How to Create the WebService and How to test the it ?


I paste the Code here,

In that Code, What is Role of NameSapce? The NameSapce ref the http://tempuri.org/, Why?

How to Call the Method HelloWorld ?

Imports System.Web.Services

<WebService(Namespace := "http://tempuri.org/")> _

Public Class Service1

Inherits System.Web.Services.WebService

#Region " Web Services Designer Generated Code "

Public Sub New()

MyBase.New()

'This call is required by the Web Services Designer.

InitializeComponent()

'Add your own initialization code after the InitializeComponent() call

End Sub

'Required by the Web Services Designer

Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Web Services Designer

'It can be modified using the Web Services Designer.

'Do not modify it using the code editor.

<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

End Sub

Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)

'CODEGEN: This procedure is required by the Web Services Designer

'Do not modify it using the code editor.

If disposing Then

If Not (components Is Nothing) Then

components.Dispose()

End If

End If

MyBase.Dispose(disposing)

End Sub

#End Region

' WEB SERVICE EXAMPLE

' The HelloWorld() example service returns the string Hello World.

' To build, uncomment the following lines then save and build the project.

' To test this web service, ensure that the .asmx file is the start page

' and press F5.

'

<WebMethod()> Public Function HelloWorld() As String

HelloWorld = "Hello World"

End Function

End Class



Thanks & Regards,
Elankathir,
ASM Technologies,
B'lore.
 
E

ElanKathir .S.N

Hi William 's

I am not get the Concept of Web services ,See I have some metrials, But
I am not undersating the thery concept of that.

If u have any interactive metrial for Web service ?


Thanks & Regards

Elankathir,
B'lore,
India.
 

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

Similar Threads


Top