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)

  Print Answers RSS
0 Kornfeld Eliyahu Peter 169
1 Zoltán Zörgő 139
2 George Jonsson 135
3 PIEBALDconsult 130
4 OriginalGriff 120
0 OriginalGriff 6,165
1 DamithSL 4,658
2 Maciej Los 4,107
3 Kornfeld Eliyahu Peter 3,649
4 Sergey Alexandrovich Kryukov 3,342


Advertise | Privacy | Mobile
Web02 | 2.8.141220.1 | Last Updated 25 Mar 2013
Copyright © CodeProject, 1999-2014
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