Click here to Skip to main content
13,043,865 members (48,366 online)
Rate this:
Please Sign up or sign in to vote.
I did a web service :

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Data.SqlClient;
using System.Data;
namespace MemberWebService
    /// <summary>
    /// Summary description for Service1
    /// </summary>
    [WebService(Namespace = "")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    // [System.Web.Script.Services.ScriptService]
    public class Service1 : System.Web.Services.WebService
        public DataSet GetMemberData(string memberId, string thirdName)
            SqlConnection cn = new SqlConnection("Data Source=.;Initial Catalog=Healthy;Integrated Security=TRUE");
            SqlDataAdapter da = new SqlDataAdapter();
            DataSet ds = new DataSet();
            da.SelectCommand = new SqlCommand("SELECT * FROM MemberMaster WHERE MemberId=@MemberId and ThirdName=@ThirdName", cn);
            da.SelectCommand.Parameters.Add("@MemberId", SqlDbType.NVarChar).Value = memberId;
            da.SelectCommand.Parameters.Add("@ThirdName", SqlDbType.NVarChar).Value = thirdName;
            return ds;

when i run it, it is working on my localhost i want to run it on another server like this link :

How can i do that ?
Posted 24-Mar-13 6:46am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

For hosting the Webservice (similar to web application):

1. In IIS7: Deploying ASP.NET Websites on IIS 7.0 [^]
2. In IIS6: Deployment of a Website on IIS[^]

How to use the hosted webservice: How to make a simple WebService and consume it.[^]
tranesyasd 27-Mar-13 3:49am
I made these steps but still my web service run on the localhost how can i host it to run the web service from another machine.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 25 Mar 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100