.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Post New Web Links

Get the requester's ip address from web service

Posted By:      Posted Date: October 08, 2010    Points: 0   Category :ASP.Net
 

I create a web service with a web method. I need to detect the requester's ip address.

Request.ServerVariables["REMOTE_ADDR"] that works in web form does not seem to work in web service.

How can I detect the requester's ip address and in which of the web service should the codes be placed?




View Complete Post


More Related Resource Links

Custom WCF Service (svc) gives address scheme error

  
Hi, I'm reading a book by Sahil Malik on building solutions for SharePoint 2010 (from Apress). One of the items explained is how to create a custom WCF service that can then be consumed in different scenarios (.NET app, silverlight, javascript). I followed the steps as given in the book, but when I try to open the URL to the service, I get this error: This collection already contains an address with scheme http.  There can be at most one address per scheme in this collection. Parameter name: item I have to mention that when I added the mapped ISAPI folder to my VS project, it didn't create the project subfolder automatically and I accidently created my files (svc and web.config) on the root level of the ISAPI folder. I created the subfolder manually and moved these two files in the subfolder, but it doesn't seem to work. Maybe I overwrote something on the root of ISAPI ? My web.config contains this: <?xml version="1.0" encoding="utf-8" ?> <configuration> <system.serviceModel> <serviceHostingEnvironment aspNetCompatibilityEnabled="true"/> <bindings> <basicHttpBinding> <binding name="customBasicHttpBinding"> <security mode="TransportCredentialOnly"> <transport clientCredentialType="Ntlm" /> </security&g

No protocol binding matches the given address 'http://0.0.0.0:1143/Host/Service.svc'.

  
I am getting this error whenever I tried to open the svc file in the browser using the Visual Studio 2008. The puzzling part is the localhost address being interpreted as '0.0.0.0 '. What are should I look for in order to troubleshoot this problem?Exception Details: System.InvalidOperationException: No protocol binding matches the given address 'http://0.0.0.0:1143/Host/Service.svc'. Protocol bindings are configured at the Site level in IIS or WAS configuration. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [InvalidOperationException: No protocol binding matches the given address 'http://0.0.0.0:1143/Host/Service.svc'. Protocol bindings are configured at the Site level in IIS or WAS configuration.][ServiceActivationException: No protocol binding matches the given address 'http://0.0.0.0:1143/Host/Service.svc'. Protocol bindings are configured at the Site level in IIS or WAS configuration.] System.ServiceModel.AsyncResult.End(IAsyncResult result) +4413209

Custom WCF Service (svc) gives address scheme error

  

Hi,

I'm reading a book by Sahil Malik on building solutions for SharePoint 2010 (from Apress).
One of the items explained is how to create a custom WCF service that can then be consumed in different scenarios (.NET app, silverlight, javascript).

I followed the steps as given in the book, but when I try to open the URL to the service, I get this error:

This collection already contains an address with scheme http.  There can be at most one address per scheme in this collection.
Parameter name: item

I have to mention that when I added the mapped ISAPI folder to my VS project, it didn't create the project subfolder automatically and I accidently created my files (svc and web.config) on the root level of the ISAPI folder. I created the subfolder manually and moved these two files in the subfolder, but it doesn't seem to work. Maybe I overwrote something on the root of ISAPI ?

My web.config contains this:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
 <system.serviceModel>
  <serviceHostingEnvir

How to get web service address in a ajax enabled page to use it in javascript

  

Hii everyone,


I have a requirement where I am using web service from  a server and adding that to a client

website .I have referenced the web service in my client web site  but not able to get the

address of web service. When I click on the path I get the disco file of web service and

the result is not displayed.My code is like this


</p><p>&lt;script&nbsp; language="javascript"&gt;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; function btnadd_Click() {

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var x = document.getElementById('txtA').value;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var y = document.getElementById('txtB').value;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var ans = WebService.Add(parseInt(x), parseInt(y), OnComplete, OnTimeOut, onerror);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return true;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }

&n

WCF Service to be hosted on the server with multiple IP Address

  

Hello all,

I am new to WCF Service. Following is my scenario

I have got a Windows Server 2008 with two NIC ie. two IP Addresses

xxx.xxx.xxx.1

xxx.xxx.xxx.2

I have got Apache server running on 1 and IIS on 2.

Now when I publish the WCF service on my service and have explicitly set the iplisten for IIS to 2. Still I am not able to access the service.

One more observation the link which I get after publishing is "svcutil.exe http://servername/Webservice/Service.svc?wsdl "

I need to have IP Address instead of servername in above URL.

Because I think the servername is causing the confusion as both IP Address 1 and 2 point to it.

Please suggest what needs to be done

Thanks in Advance.


Cannot read Silverlight client ip-address in service

  

I'm using the following code to read the ip address and port from a client that connects to my service:

            //Read IP-address and port
            MessageProperties messageProperties = OperationContext.Current.IncomingMessageProperties;
            RemoteEndpointMessageProperty endpointProperty = messageProperties[RemoteEndpointMessageProperty.Name] as RemoteEndpointMessageProperty;
            string ip = endpointProperty.Address;
            string port = endpointProperty.Port.ToString();

If I connect with a wpf client using netTcp binding I can read the proper ip adress and port number but if I connect with a SL4-client with the PollingDuplex the ip adress is empty and the port is 0. Why is that?

Thanks for help!

EDIT: I noticed that it works as supposed for Silverlight 3 so this seems to be SL4 specific.


Problem with getting client's IP address in WCF service on IIS7

  

Hi,

I have deployed a WCF duplex service on IIS7 that gets the client's IP address and based on that if the IP address repeats, the client is not given access to service. The problem is that when I deploy it on IIS7 and try to access it from another PC on LAN, it identifies the new PC having the same IP address as the one that the service is deployed in(just for testing purpose, I am returning the retrieved IP address to client), and So, I am not able to access the service from another PC. 

Can anyone help me with this?

Thanks.

 


Windows Service Applications Tutorials

  
You can easily create services by creating an application that is installed as a service. For example, suppose you want to monitor performance counter data and react to threshold values. You could write a Windows Service application that listens to the performance counter data, deploy the application, and begin collecting and analyzing data.

IP Address Blocking or Restriction in SQL Server

  
"is it possible to block connections to SQL Server based on IP address". As far as now there is no official way in SQL Server to block the connections in SQL Server based on IP address. However this can be done from the OS end, we have the following three options available, refer HERE for more.


.Firewall
.IPSec
.RRAS IP Filter

WCF Tip: Using Properties in Service Contracts

  
you'll notice all of the Service Contracts are implemented with interfaces containing only methods. For the longest time I thought that's all that was supported, until I thought about it a little more. In C# land, properties are simply wrappers around a get method and set method, so why wouldn't we be able to use properties in a service contract? Well the answer is we can.

Realizing a Service-Oriented Architecture with .NET

  
This article is meant to be a practical discussion guide to building a .NET application in a service-oriented architecture. We will consider real-world goals, real-world obstacles, and experience-based solutions. I quickly concede the approaches discussed here are not exhaustive or infallible. This paper is focused on application development, not application integration. We will specifically consider architectural issues and component design issues.

The Potential of Web Services

my ip address

  
IP Tejji answers question like what is my ip address? find my ip addresss? detect my ip address? Best part is it also determines your local ip address as well as mac address. Further if you keen on browser specification and details regarding browser capabilities can also be found. It also help you see your geographic location. Other details that are available are Latitude, Longitude, timezone, country, region & city. In short it is one-stop-shop for very rich details about your IP and related information.

Web Service for uploading documents into SharePoint

  
WS UploadService is a web service written for Microsoft Office SharePoint Server 2007 and Windows SharePoint Services 3.0 and is meant for uploading documents into SharePoint. I have just uploaded the zip file to GotDotNet.com so it will take some time before the zip file appears in the list of downloads. For the time being, you can download the zip file from the following location

Creating and Using an ASP.NET Web Service in Visual Web Developer

  
In addition to letting you create Web pages, Microsoft Visual Studio also lets you create Web services that use ASP.NET XML. Creating a Web service in Visual Studio is similar to creating a Web page. You can also use the Microsoft Visual Web Developer Web development tool to reference and use Web services that are in a Visual Web Developer solution, on your local computer or in a local or external UDDI directory. In this walkthrough, you will create the Web service in one solution and use it in another.

Tasks illustrated in this walkthrough include:

Creating a simple XML Web service in Visual Web Developer.

Creating a separate Web site that uses the Web service.

AutoGenerateSelectButton="False" ignored when using Domain Service

  

Crosspost from RIA Services forum: http://forums.silverlight.net/forums/t/196466.aspx

I'm creating a Dynamic Data application in VS2010 and have recently switched to using a Domain Service to give greater control over the data presented to the client. I've noticed that the AutoGenerate<Action>Button attributes on my GridView are being ignored. The presence of the Edit and Delete buttons appear to be contingent on the existence of Update and Delete methods on the partial classes autogenerated in the Domain Service, but i'm not seeing how to control the generation of the Select button. Is there a way to control this from within the Domain Service class?


Any framework for creating a job scheduler service?

  

Just curious to know if there was any official Microsoft code blocks, classes, or such for writing a service that runs other assemblies or WCF services?  That can be configured easily from a web page, pre-coded, for running tasks at certain times on certain recurring intervals?  I've already built one but am open to anything done better- which I'm sure there is.  Thanks!!!


Convert WCF service to self hosting application

  

 I created project as a  WCF Service application and now according to recuriment that needs to be converted as a self hosting application

How can i do this?

Converting WCF service app to Self hosting app?


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend