none
Web Service

    Question

  • I am working on a Windows XP Home Edition computer. The web service is on the same comuter as the consumer application. I am using Visual Studion Web Developer Express edition.

     

    When attempting to add the web service without specifiy the port, but only 'localhost', I get the following message:

     

    There was an error downloading 'http://localhost/HelloWorldThreeService/WebService.asmx'.
    Unable to connect to the remote server
    No connection could be made because the target machine actively refused it 127.0.0.1:80
    Metadata contains a reference that cannot be resolved: 'http://localhost/HelloWorldThreeService/WebService.asmx'.
    Could not connect to http://localhost/HelloWorldThreeService/WebService.asmx. TCP error code 10061: No connection could be made because the target machine actively refused it 127.0.0.1:80.
    Unable to connect to the remote server
    No connection could be made because the target machine actively refused it 127.0.0.1:80
    If the service is defined in the current solution, try building the solution and adding the service reference again.

     working on a Windows XP Home Edition computer. When attempting to add a web service using Visual Web Developer Express edition, I get the following error message:

     

     

    Wednesday, May 21, 2008 2:59 AM

Answers

  • The program has successfuly executed. I restarted the web service producer and the consumer. On the consumer application, I set the property "Use dynamic ports" to True.  This is the code for the Default.aspx.cs file:

     

    using System;

    using System.Configuration;

    using System.Data;

    using System.Linq;

    using System.Web;

    using System.Web.Security;

    using System.Web.UI;

    using System.Web.UI.HtmlControls;

    using System.Web.UI.WebControls;

    using System.Web.UI.WebControls.WebParts;

    using System.Xml.Linq;

    using System.Web.Services;

    using ServiceReference1;

     

    public partial class _Default : System.Web.UI.Page

    {

    protected void Page_Load(object sender, EventArgs e)

    {

    ServiceSoapClient service = new ServiceSoapClient();

    Label1.Text = service.HelloWorld();

    }

    }

     

    This code allowed me to consume a web service written in one instance of Visual Web Developer by an application written in another instance of Visual Web Developer.

    Sunday, May 25, 2008 8:21 PM

All replies

  • Have you checked firewall settings?
    Wednesday, May 21, 2008 6:30 AM
  • Do you have IIS installed in your local machine? Also check if you have unblocked port 80 in your firewall.

     

    Wednesday, May 21, 2008 7:37 AM
  • Port 80 is not blocked. This is a Windows XP Home Edition computer, so IIS is not available.

    Wednesday, May 21, 2008 8:50 PM
  • I am unable to ping 127.0.0.1:80

    Wednesday, May 21, 2008 8:53 PM
  • How are you pinging a specific port?

     

    If you don't have IIS running what is listening for requests on port 80?

    Wednesday, May 21, 2008 9:03 PM
    Moderator
  • I see your point. I am able to ping 127.0.0.1

    Wednesday, May 21, 2008 9:06 PM
  • That just means the computer has a TCP stack running.

     

    Wednesday, May 21, 2008 9:06 PM
    Moderator
  • Also windows ping command uses ICMP protocol which according to OSI model is on Network layer protocol. Because of that user cannot specify which ports to ping - since ports are specific to the Transport layer.
    Try to use 'netstat' command to see if your server is listening.

    HTH
    PK
    Thursday, May 22, 2008 9:18 AM
  • What is the format for using the "netstat" command?

    Thursday, May 22, 2008 11:51 AM
  • If tou want to determine if your server application is up and running, you can type 'netstat -na'. You should see something like:
    Protocl TCP, Local address 0.0.0.0:80, Foreign Port 0.0.0.0:0, state Listening

    I still belive that, in your case something could block incoming connections ( like windows firewall - try to desable it ), or just your web service is down.

    Hope this helps
    PK
    Thursday, May 22, 2008 1:51 PM
  • "netstat -a -n | FINDSTR LISTENING" if you just want to see listening applications.  If you do having something listening, then it's being blocked by your firewall.  I doubt you have anything listening though.

    Thursday, May 22, 2008 3:51 PM
    Moderator
  • Do you know of any web link which details use of the "netstat" command?

    Thursday, May 22, 2008 3:57 PM
  • The program has successfuly executed. I restarted the web service producer and the consumer. On the consumer application, I set the property "Use dynamic ports" to True.  This is the code for the Default.aspx.cs file:

     

    using System;

    using System.Configuration;

    using System.Data;

    using System.Linq;

    using System.Web;

    using System.Web.Security;

    using System.Web.UI;

    using System.Web.UI.HtmlControls;

    using System.Web.UI.WebControls;

    using System.Web.UI.WebControls.WebParts;

    using System.Xml.Linq;

    using System.Web.Services;

    using ServiceReference1;

     

    public partial class _Default : System.Web.UI.Page

    {

    protected void Page_Load(object sender, EventArgs e)

    {

    ServiceSoapClient service = new ServiceSoapClient();

    Label1.Text = service.HelloWorld();

    }

    }

     

    This code allowed me to consume a web service written in one instance of Visual Web Developer by an application written in another instance of Visual Web Developer.

    Sunday, May 25, 2008 8:21 PM