As I have already figured out. I want to create a web service on IIS to test my web service. But my question is, I have to select the binding type. there are HTTP, net.tcp …. but I have not only HTTP connection with the client. In my case I have to send data to the client by using their IP address(Its stored in a database). So my question is how should I configure it.
server side contains this code also
public void Notify(string ipAddress) //List<string> ipList
{
try
{
Socket sock = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
IPAddress ip = IPAddress.Parse(ipAddress);
IPEndPoint endPoint = new IPEndPoint(ip, 15000);
string notification = "new_update";
byte[] sendBuffer = Encoding.ASCII.GetBytes(notification);
sock.SendTo(sendBuffer, endPoint);
sock.Close();
}
catch
{
}
}
I also would like to know any resources on configuring IIS to deploy a web service with greater details.
Thank you!!
Deploying a web service is same as deploying a web site in the IIS7 manager.
This piece of code works fine on the IIS7, But the problem arises when the using this piece of code in world scenarios. The deviation from the client server concept(Ex: Client also acts as a server at the same time).
The web service can get the clients IP address by using the following code inside a web method
But this will not provide the real IP address of the client. It depends on the network devices and the ISP policy. So its better to re-think the design before going to this approach. But this works inside a local network.