Run a Web Service in IIS

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lalindu
    New Member
    • Feb 2007
    • 2

    Run a Web Service in IIS

    i simply create a webservice (Add two numbers) in a ASP.NET page usin vb.net 2005. when i run it usin vb.net it runs using some "localhost port"(ex:-"http://localhost:1543/........").so then i can access those methods using that url.but i cant access that from an another machine by typing my IP Address and other <service>.asm x page.
    my simple Service is:-
    *************** *************** *************** *************** *************** *************** *
    Imports System.Web
    Imports System.Web.Serv ices
    Imports System.Web.Serv ices.Protocols
    Public Class Service
    Inherits System.Web.Serv ices.WebService

    <WebMethod()> _
    Public Function add(ByVal a As Integer, ByVal b As Integer) As Integer
    Return a + b
    End Function

    End Class
    *************** *************** *************** *************** *************** *************** **
    (i use vb.net 2005,windows 2000 SP4,IIS Version 5 )

    Isimply copy and paste my web service folder to "\Inetpub\wwwro ot" and run it.

    i reseive this error message:-
    *************** *************** *************** *************** *************** *************** *
    Server Error in '/' Application.
    Configuration Error
    Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

    Parser Error Message: It is an error to use a section registered as allowDefinition ='MachineToAppl ication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.

    Source Error:

    Line 49: ASP.NET to identify an incoming user.
    Line 50: -->
    Line 51: <authenticati on mode="Windows"/>
    Line 52: <!--
    Line 53: The <customErrors > section enables configuration


    Source File: c:\inetpub\wwwr oot\webtesth1\w eb.config
    Line: 51
    *************** *************** *************** *************** *************** *************** **
    please help me to solve this.
    (I am new to ASP.NET and Web services. I have fair knowledge of all Vb versions,vb, Vb.net 2003 and Vn.net 2005)
    Finally I reset the IIS server as MSDN site
  • kenobewan
    Recognized Expert Specialist
    • Dec 2006
    • 4871

    #2
    Have you set up a virtual directory in IIS for the service?

    Comment

    • lalindu
      New Member
      • Feb 2007
      • 2

      #3
      Originally posted by kenobewan
      Have you set up a virtual directory in IIS for the service?
      thanks friend for helpin me.
      i solwed it.
      cause for the error is, when i create web service i have to choose "localhost" . but i choosed "file systems"
      thanks anyway.

      Comment

      • kenobewan
        Recognized Expert Specialist
        • Dec 2006
        • 4871

        #4
        Well done!

        Comment

        Working...