Click here to Skip to main content
Rate this: bad
good
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 = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // 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
    {
 
        [WebMethod]
        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;
 
            ds.Clear();
            da.Fill(ds);
            return ds;
        }
    }
}
 
when i run it, it is working on my localhost i want to run it on another server like this link : http://62.215.220.133/SHAMiphone/sip.asmx
 
How can i do that ?
Posted 24-Mar-13 7:46am

1 solution

Rate this: bad
good
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.[^]
  Permalink  
Comments
tranesyasd at 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)



Advertise | Privacy | Mobile
Web04 | 2.8.150129.1 | Last Updated 25 Mar 2013
Copyright © CodeProject, 1999-2015
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