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


Top 5 Contributors of the Month
MarieAdela
Imran Ghani
Post New Web Links

Get clients public IP NOT local IP from a WCF Service

Posted By:      Posted Date: October 10, 2010    Points: 0   Category :WCF
 
Does anyone know how to get the clients public IP from a WCF service. To get the local IP I did the following:

public string GetLocalIPAndPort()
    {
      OperationContext context = OperationContext.Current;
      MessageProperties messageProperties = context.IncomingMessageProperties;
      RemoteEndpointMessageProperty endpoint = messageProperties[RemoteEndpointMessageProperty.Name] as RemoteEndpointMessageProperty;

      return endpoint.Address + ':' + endpoint.Port;
    }




But I want the real IP


View Complete Post


More Related Resource Links

Service Station: Building RESTful Clients

  

This column how to build clients applications based on the REST architecture using HTTP AP1s. The article describes how to address the question of autogenerated types and code.

Jon Flanders

MSDN Magazine October 2009


Getting Local Machine Info from Web Service

  
Hi there, im pretty new to using web services and i have an application which connects to a webservice, the problem is however is that i need to be able to get the local machine info e.g machine name, drives etc...from the webservice and i have no idea how to do this! Any help would be much appreciated!Phil

Public WCF services for testing clients

  
I try to find some (public) WCF services out there, but do not succeed. I want to talk to some for testing my work with clients. Any list ?

Duplex communication and calling clients from outside the hosted service

  
Hey,   I am currently building an interface between two applications: One that hosts a WCF service and receives external input (e.g. from a sensory system) and another which subscribes to updates sent by the first.   It is quite easy to call back to the client if I create a ServiceHost and provide it with an instance of my service (using ServiceHost.SingletonInstance). However, if I use a PerSession instance mode, how is it possible to call the clients when I receive an updated from the external sensory system?   Thank you for your time!   Cheers, Till

Exposing WCF Service for multiple clients with the feature of multiple database support

  
i have ceated a WCF service and hosted it properly. now i want to Exposing this Service for multiple clients with the feature of multiple database support.In this functionality how could i do the proper multiple database management. what i am doing now:1. i am taking database string from the client.2. Then setting the refference of above provided database to the all functions call.ISSUE: if the mulitple clients calling the service at the same time and both are giving different database string then the database string provided by the clients is overlapping.....

SQLCLI service not registered on the local machine error

  
Hi, With reference to the above title, I am trying to connect an SQL Server 2008 Express instance which came along with Visual Studio 2010 Ultimate from my C# app. My connection string is: Provider= SQLNCLI;Server=host\SQLEXPRESS;Database=database; When I try connecting with the above connection string, it says: SQLNCLI provider not registered on the local machine followed by my connection string. What am I supposed to do to solve this issue? Thank You in advance for your reply. Regards, Clifford

Can´t set up local system accounts as service accounts in sharepoint 2010

  
HI I made an inplace upgrade to sharepoint 2010. I want to setup performance point services. but it doesn´t allow me to set a local system account as the application pool account for performance point services application. It doesn´t allow me to register a new account it says The specified user account "domain\username" is a local account. Local accounts should only be used in stand alone mode. The application pool account for the site collection that I upgraded is a local system account so I don´t get it? I tried this http://sharepoint.microsoft.com/blogs/fromthefield/Lists/Posts/Post.aspx?ID=112 However the upgrade fails after this. Is there any way that I do the inplace upgrade and it would allow me to use local system accounts has service accounts? Without Active directory? Thanks      

Accounts used by application pools or service identities are in the local machine Administrators gro

  
ERROR: Using highly-privileged accounts as application pool or as service identities poses a security risk to the farm, and could allow malicious code to execute.  The following services are currently running as accounts in the machine Administrators group: SharePoint Central Administration v4 (Application Pool) SPTimerV4(Windows Service) there are 2 accounts associated with this install. 1. SQL ACCOUNT 2. SP Admin account(farm) the admin account has the following listed components    Farm components using this account      Microsoft SharePoint Foundation Application Pool: SharePoint - 80 SharePoint Server Search Web Analytics Data Processing Service Farm Account User Profile Synchronization Service Microsoft SharePoint Foundation Sandboxed Code Service Access Services Secure Store Service PowerPoint Service Application Word Viewing Service PerformancePoint Service Application Visio Graphics Service Managed Metadata Service Web Analytics Service Application Word Automation Services Excel Services Application Business Data Connectivity Service Search Administration Web Service for Search Service Application User Profile Service Application Search Service Application Application Discovery and Load Balancer Service Application Security Token Service Application   The farm account is not listed in the local machines admi

WCF - How do I hide service operations from specific clients?

  

Hi

I'm doing my final project and I've run into a problem. I have a WCF service, which distributes 10 service operations. One of the service operations should be hidden from all clients, except a specific one. How do I go about solving this problem? I could 1 implement some sort of password mechanism, where you have to send a password in the argument of the service operation. I could also make a new service just for that client... Any ideas?


Unable to connect to local host service when a splash screen is show before start the services

  
Hi all:


I want to show a splash screen before start the local host services, the host can be open without error, however the client (Form1) is not able to connect to the service. Without the splash screen, every thing work fine. Any idea why ?

Here is the code.



Imports System.ServiceModel


<ServiceContract()> _
Public Interface IHelloWorldService
   <OperationContract()> _
   Function SayHello(ByVal name As String) As String
End Interface

Public Class HelloWorldService
   Implements IHelloWorldService

   Public Function SayHello(ByVal name As String) As String Implements IHelloWorldService.SayHello
      Return String.Format("Hello, {0}", name)
   End Function
End Class

Module Module1
   Private host As ServiceHost
   Private frmSplash As Form

   Sub Main()
      AddHandler AppDomain.CurrentDomain.AssemblyLoad, Addres

Downloading a document from a sharepoint site to local file system, copy web service returns null

  
Hi Guys,
               I am trying to get this done for the last 2 days and I am still banging my head to the wall.
All I need to do is to download files from my sharepoint site library that uses integrated windows authentication. I was using copy webservice : getItem method to accomplish this.

CopyService.GetItem(copySource, out myFieldInfoArray, out myByteArray);

Problem : myByteArray is always returned as NULL

Note: I have tried the same with another site that uses forms authentication but the result was the same (NULL !!)


This is my code:

CopyService.

Copy copy = new CopyService.Copy();

 

"net.local" transport in Windows Service

  

Hello,

I have been trying the LocalChannel (Channels Extensibility) sample provided with the RC version of .NET 4.0.

For some reason, the channel extension code provided by the sample does not work when hosted in a Windows (NT) service. The WCF client sends the message to the WCF server, but the ServiceHost does not even instantiate a Service instance.

The sample runs fine when hosted in a Console application. What is the reason it does not work in a Windows service?

Thanks,
Satyen


Debug WCF Service hosted on local IIS not working

  

I have one solution WCFSampleSolution and it has all my projects - Web Service, Client and Website. The structure is something like:

 + WCFSampleSolution
    - C:\WCFSample\Website
    - WCFService
    - WCFWebClient

I created WCFService project for my services. It contains IService1.cs and Service1.cs. Then I hosted the service in IIS. I did this by creating a website and adding .svc and web.config files to the website project. Then published it in IIS. When I run http:\\MyMachineName\Website\Service.svc, it shows the service description. Then I create the web client that calls the webservice. I used the service reference to add the service. It calls a method of Service1. It works fine. But I amnot able to debug this program/setup. I verified the config files in WCFWebClient project and Website project and they have proper debug settings.

<compilation debug="true">


 

I put break points but control never goes to my seb service. I also tried attach process, but it also doesn't work. But I was able to debug one of my other WCF projects. The setup was little different. In that project I copied the .svc file and config in my web client and the debug works fine.

Please HELP!!


Debug WCF Service hosted in local IIS not working

  

I have one solution WCFSampleSolution and it has all my projects - Web Service, Client and Website. The structure is something like:

 + WCFSampleSolution
    - C:\WCFSample\Website
    - WCFService
    - WCFWebClient

I created WCFService project for my services. It contains IService1.cs and Service1.cs. Then I hosted the service in IIS. I did this by creating a website and adding .svc and web.config files to the website project. Then published it in IIS. When I run http:\\MyMachineName\Website\Service.svc, it shows the service description. Then I create the web client that calls the webservice. I used the service reference to add the service. It calls a method of Service1. It works fine. But I amnot able to debug this program/setup. I verified the config files in WCFWebClient project and Website project and they have proper debug settings.

<compilation debug="true">

I put break points but control never goes to my seb service. I also tried attach process, but it also doesn't work. But I was able to debug one of my other WCF projects. The setup was little different. In that project I copied the .svc file and config in my web client and the debug works fine.

Please HELP!!


Regarding backup of database to public ip system from local system

  

Hi,

how to take backup of database from local system to public ip system?

Database on local system..

that backup file should be on that public ip system..

Please help me ASAP

Thanks in advance.


New public class in namespace (web service, asmx)

  

 Hi,

I have a working web service written in C#.NET that was set up by my predecessor, and have been able to successfully modify it in the past. It works without problems in production.

Basically, the service takes XML code and sends it to a postURL with an outside vendor API. They send back an XML document that we then parse out.

My issue is that I need to connect to another vendor API concurrently with the existing one.

Method 1) Should I create an entirely new Web Service for the new vendor? I tried this but there seemed to be an issue with the ports, having them run at the same time. Should I try again? Any port secrets?

Getting stuck on Method 1, I'm on to Method 2 now....

Method 2) Modifying the exiting web service by adding a new public class to the namespace. I also modified the wsdl, disco and discomap files for the new service. It did compile, but something is missing.

Service1 = exisiting, working web service

https://servername/Service1.asmx - works beautifully and lists all my API calls

https://servername/Service1.aspm?wsdl - shows my wsdl file

Service2 = new, copied web service

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