CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2009
    Posts
    6

    Problems accesing Web Service on LAN

    Hi everybody,

    I´m starting to dive into the web services and the IIS world and i´m having a problem. My OS is windows xp prof. and i´ve installed IIS 6.0. For code programming i´m using Visual Studio 2005.

    I´ve created a simple web service in C#, it´s code:

    using System;
    using System.Data;
    using System.Web;
    using System.Collections;
    using System.Web.Services;
    using System.Web.Services.Protocols;
    using System.ComponentModel;

    namespace MyService
    {

    [WebService(Namespace = "http://codeproject.com/webservices/",
    Description = "This is a demonstration WebService.")]
    public class Service1 : System.Web.Services.WebService
    {

    [WebMethod]
    public string HelloWorld()
    {
    return "Hello World!";
    }
    }
    }
    After building it i´ve created another C# app to use the web service. First i tried it in localhost. The app look like this:

    using System;
    using System.IO;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;
    using System.Net;

    namespace embedFlash
    {
    public partial class Form1 : Form
    {
    localhost.Service1 webservice = new localhost.Service1();

    public Form1()
    {
    InitializeComponent();
    string result;
    result = webservice.HelloWorld();
    }

    private void Form1_Load(object sender, EventArgs e)
    {

    }
    }
    }

    Where localhost is a 'Web Reference' with the URL:

    http://localhost:1713/Service1.asmx

    It worked ok. My next step was to use the service from another PC on the same LAN. In this case the web reference i´ve created is:

    http://[IP of the server PC]:1713/Service1.asmx

    But when i try this i get an error:

    'Cannot establish connection with IP:1713 because it refused it'

    ...i don´t know what´s wrong...

    Tried to ping from one to the other and succesed.
    Tried to connect them directly but it didn´t work.
    Tried different URL combination but nothing.

    Any idea?

    Thanks in advance.

  2. #2
    Join Date
    Jun 2009
    Posts
    6

    Re: Problems accesing Web Service on LAN

    I forgot to say that i also tried to turn off both firewall but nothing.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured