RESTful services //how to get Client Ip ?
Hi
I'm implementing all our services intro RESTful. Here we are looking to fetch the client ip address and save in db. But I'm not able to do that in rest services . Please advice me
thanks,
-raghu
String ipAddress = request.getHeader("X-FORWARDED-FOR");
if(ipAddress == null)
ipAddress = request.getRemoteAddr();
System.out.println("ipAddress:"+ipAddress);
Similar Messages
-
How to get client IP in custom UCM Service
how to get client IP in custom UCM Service ?
have you tried
binder.getLocal("REMOTE_ADDR");
Let us know how you get on
Tim -
How to get Client IP address in oracle apps. Are there any API's.
hi,
I have one query
->How to get Client IP address in oracle apps. Are there any API's.
regards,
krishnaHi,
this is very usefull
however are this data stored on the db or is only a temporary view?
I would like to have to keep track of all client connected.
Thanx a lot -
How to get client machine name and IP address
Hi,
In my office I have one SERVER which has FORMS & Report Server installed and all the clients are accessing that application thru the following URL :
http://OraServer:8889/forms/frmservlet
to get the machine name I have read into a global variable like this
SELECT USERENV('TERMINAL' ) into :global.clientname FROM DUAL;
but obviously all the time its returning the SERVER machine name...not the name where client is accessing the program....so how can I get the client machine name..
thanksHi Frank,
Well I am using Developer Suite 10g Release (10.1.2.0.2) ..I've gone thru the link what you have sent me and noticed that whatever updations of conf file or classpath its already there so i guess needn't to modify cause I think my release 10.1.2.0.2 has did already as webutils been bundled with it.
Well What i did is to double click on ATTACH LIBRARY and browse the location to find webutil.pll and finally attached it...even though its showing me all the procedures like clientinfo and others...
on my block's canvas I've put a button and used this trigger to get client info function like this.
when-button-pressed trigger of INFOBUTTON
DECLARE
o_clientinfo varchar2(50) := Webutil_clientinfo.GET_HOST_NAME ;
begin
message(o_clientinfo);
end;
but when I am trying to open this form its simply not showing up..strange thing is that there is no error as well...so plz kindly guide me how to get clientinfo hostname or ipaddress using that library function.
thanks -
Hi Experts,
I have a problem in retrieving my client's computer name and its username using windows api..
Coz my program is using JNI so for the windowsAPI i used GetUserName and Get ComputerName --> It gives me the username and the computer name of the server..
Any idea how to get another (computer username and its computer name PASSWORD IF POSSIBLE) that logon to my server.
Any suggestion will be highly appreciated..
Thank you
SuwandyAny idea how to get another (computer username and its
computer name PASSWORD IF POSSIBLE) that logon to my
server.
High hopes
What are your clients?
Java,jsp,html or are they servlets
-Regards
Manikantan -
RESTful service with POST, GET, PUT and DELETE
I'm implementing a RESTful service, but mod_plsql only gives me GET, POST and HEAD commands.
However, if I try to use the PUT command, the response is:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML><HEAD>
<TITLE>501 Method Not Implemented</TITLE>
</HEAD><BODY>
<H1>Method Not Implemented</H1>
PUT to *** not supported.<P>
mod_plsql: request method not supported<P>
<HR>
<ADDRESS>Oracle-Application-Server-10g/10.1.3.1.0 Oracle-HTTP-Server Server at *** Port 80</ADDRESS>
</BODY></HTML>Is it possible to add support for PUT and DELETE in mod_plsql?
I've search all packages and code, but I haven't found anything that specifies the valid HTTP commands or the source for generating the above error message.AIR supports all the specified HTTP methods, but there seems to be a bug in the HTTPService class. Instead you should use URLLoader and URLRequest. If you change to that you won't even need to use the Method Override header.
Read more here : http://spy6.blogspot.com/2009/06/adobe-air-put-delete-head-http-methods.html . -
How to get client Ip address from web service
Hello folks,
I am quite new to web service and developing a web service using netbeans6.0 IDE, where i have to know which client called/used the service, After googling i got code snippet like below
inject a WebServiceContext instance into your WebService class, and use it in each WebMethod to get the current request's MessageContext Map. Get the SERVLET_REQUEST item from that, cast as an HttpServletRequest. From that HttpServletRequest, you can invoke getRemoteAddr() to get the client's IP.
@WebService
public class MyService{
@Resource
WebServiceContext wsCtxt;
@WebMethod
public void myWebMethod(){
MessageContext msgCtxt = wsCtxt.getMessageContext();
HttpServletRequest req = (HttpServletRequest)msgCtxt.get(MessageContext.SERVLET_REQUEST);
String clientIP = req.getRemoteAddr();
}But it throws error in my PC like
Service invocation threw an exception with message : null; Refer to the server log for more details
Exceptions details : java.lang.reflect.InvocationTargetExceptionIs there any way that says client pc ip address using netbeans6.0 Or what went wrong in my code?
Largely Thanks in advance.
SRI.I am afraid,
javax.servlet.ServletException: java.lang.reflect.InvocationTargetException
at com.sun.enterprise.webservice.monitoring.WebServiceTesterServlet.doPost(WebServiceTesterServlet.java:340)
at com.sun.enterprise.webservice.monitoring.WebServiceTesterServlet.invoke(WebServiceTesterServlet.java:121)
at com.sun.enterprise.webservice.JAXWSServlet.doPost(JAXWSServlet.java:148)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:738)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:288)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:270)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:339)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:261)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:212)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.enterprise.webservice.monitoring.WebServiceTesterServlet.doPost(WebServiceTesterServlet.java:311) ... 35 more Caused by: javax.xml.ws.soap.SOAPFaultException: java.lang.NullPointerException at com.sun.xml.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:187) at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:117) at $Proxy102.processMessage999(Unknown Source) ... 40 more Caused by: java.lang.NullPointerException at org.shar.Handle.processMessage999(Handle.java:120) at com.sun.enterprise.web.portunif.PortUnificationPipeline$PUTask.doTask(PortUnificationPipeline.java:361) ... 2 more -
How to get clients connected in WMS on windows server 2008 with c# coding
Sorry to bother anyone about this question.
Can anyone knows how to retrieve amount of client connection to Windows Media Server in real time same as WMS does on server console by c# programming ?
I got logfiles of WMS in system32 directory for details but it must be off-line of all connections which will able to get those informations for doing anything,but in this case I want real time client connection
at online when a client connects to WMS that I will get amout of that client also.
I have tried to search Windows Media Service SDK to develop this on my Windows 7 OS,but I did not find that really.
Can anyone knows this,please ?
Regards,
BigBermHi SYaGCi,
Denis is right this is actually documented in the Supported Platforms Documentation:
"Windows 7 and Windows Server 2008 R2 are new platform support additions in Service Pack 3 which are only available for support on the SP3 full release install of SAP BusinessObjects Enterprise. The SP3 patch only release of SAP BusinessObjects Enterprise does not provide support for these two new platforms."
Kind regards,
John -
Web Services: How to get the username token?
Hello everybody,
I wrote an EJB, Exposed it as a web service.
I'm using encryption+username as the inbound policy.
The client is adding a username token to the message.
I understood that the userpassword are checked automatically and I don't need to implement that myself but I need the userpassword from this token for another reason.
How can I get this information in the EJB's code?
Thanks, Adi.You can get the user from Session Bean's context.
myContext.getCallerPrincipal();
I think you cannot get the password. That way, it would be easy to disguise your WS as another one you could want to crack.
Regards. -
Hi guys,
I am building a client server JSF web application.
How to retrieve details of client machine (e.g Lan ID) on the server side when client send a request to open a web page.
Thanks.Hi Raymond,
Thanks for the reply.
I've tried in a simple servlet as following.
req.getRemoteUser() returns null
req.getRemoteAddr() returns proxy ip address.
I still can't get the LAN ID of the client who send the request.
Please help.
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class Remote extends HttpServlet{
public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException{
res.setContentType("text/html");
PrintWriter out = res.getWriter();
String rmtName = req.getRemoteUser();
String rmtAddr = req.getRemoteAddr();
out.println("<html>");
out.println("<head></head>");
out.println("<body>"+ rmtName + " ," + rmtAddr + "</body>");
out.println("</html>");
public void doPost (HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException{
doGet(req,res);
} -
How to get Client ID and Client Secret for Office App for Word which accessing SharePoint Online
we currently implementing an Office App for MS Word which access SharePoint list and get data from lists. Our aim is any user can get this app from Office App store and enter their SharePoint URL and browse their own SharePoint lists and use those. When
I was checking mechanisms which you used to access SharePoint, in some of them have used ClientId and Client Secret to authenticate with SharePoint. I have following questions.
1.If I want to sell my app using Office app store where can I get those clientId and client secret which is used to get the access tokens.
2.Is it possible to create SharePoint app and publish it to SharePoint app store and get clientId and client secret and use it when accessing through office. So users first download our SharePoint app install it to their SharePoint environment then get out
Office App from Office app store and add it to word. Will this work?Hi,
>> We are planning to develop an Office app to access SharePoint Online and SharePoint on Premise from Microsoft word.
I’m not very familiar with SharePoint development, so please correct me if I have any misunderstandings about your requirement.
The basic components of an app for Office are an XML manifest file and the default webpage of your app (server side).
>> If I'm publishing my Office App for Word in to the Microsoft office app store, how do I get the ClientId and ClientSecret which I need to pass to authenticate with SharePoint online?
As far as I know, when register your web app to SharePoint Online, you will get the ClientId and ClientSecret from the Azure Active Directory. And you need to store the Client ID and Client
Secret on the app server side.
For details, you could reference the article
Building an Office 365 ASP.NET MVC app.
>> If ClientId and ClientSecret not providing when we publishing Word Office App to the app store how what the ways which we can use to authenticate with SharePoint using Word Office app?
You don’t need to provide the ClientId and ClientSecret when publishing your App to App Store. They are stored on your app server side.
By the way, if you have the question about how to access the SharePoint resource in a Web Application, I will suggest you posting the questions to
SharePoint Development Forum. For this forum, we mainly discuss the questions about using the Office JavaScript API to develop Apps for Office.
Regards,
Jeffrey
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
How to get client computer name in Developer 9i
Hi ..
I m using developer 9i from several days.But i need to get the client computer name.But i heard that i need to use GetClientInfo java bean to get that.How to use GetClientInfo.What is the procedure to use that?What code i should use?In Sample code in this site..there was a example.But in that example there is nothing clear.What to do and what code should i use?
SharifThis shouldn't be any problems if you'd successfully installed the Forms Demos. Anyhow, another way is to use WebUtil which I'd prefer. There's tons of other interesting and useful functions in WebUtil.
Also, I'd really, really think about using Forms 10g instead of 9i.
Regards,
Martin Malmstrom -
How to get client IP or machine Host name of connected user?
I'm running my Web app on tomcat 6
I want to find out the ips/Host name (any information about the user) of the user that logging into my web app... i tryed the following :
.getRemoteAddr() and getRemoteHost() from the request and even getHeader("x-forwarded-for") but all this return nothing...
the web app is inside the company and users connects from inside the comp's also....
all user connect from Windows machines
how can i get the information of the user?
Thanks ahead.
Edited by: vedmack on Jan 27, 2009 9:28 PMhere it is:
i replaced several string with the following : companyname, servername, WebAppName this three names are the same for all users that are doing the log in ... so its irrelevant anyway.... so there is not helpfull information in this headers....
via=1.0 companyname-PRX
cookie=JSESSIONID=326E2E62678C8B55063F60A432C8A306
content-type=application/x-www-form-urlencoded
user-agent=Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 1.1.4322)
host=servername.companyname.com:9080
accept=image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-silverlight, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, application/x-shockwave-flash, */*
referer=http://servername.companyname.com:9080/WebAppName/
accept-language=he
pragma=no-cache
x-novinet=v1.2
connection=Keep-Alive
content-length=158 -
HTTP SERVICE - How to get the value of my params on the server side
I am new to flex and with the url limitation i was trying to
do the following ....send a bunch of ids... using params variable
var myservice:HTTPService = new HTTPService();
myservice.url = url;
myservice.method = "POST";
myservice.resultFormat = "e4x";
myservice.send(params);
The question is how do i get the value i passed on using
params on the server side? can the variable params be a string or
array or does it have to be object type?
Any help would be greatly appreciated.Most server side languages have a function or an array where
you extract the variables. in PHP they arrive in global arrays
called $_POST and $_GET.
Other languages have methods like request.formvars or
request.query. Check your serverside language on how that is
done. -
SharePoint 2013 Rest Api - How to get List Items
Can anyone let me know why the below method fails? I am not getting where i am making mistake. Please help
function getListItems(term) {
var caml = "<View><Query><Where><BeginsWith><FieldRef Name=Title/><Value Type='Text'>" + term + "</Value></BeginsWith></Where></Query></View>";
var requestData = { "query": { "__metadata": { "type": "SP.CamlQuery" }, "ViewXml": caml } };
$.ajax({
url: _spPageContextInfo.webAbsoluteUrl + "/_api/Web/Lists/getbytitle('SampleList')/Getitems",
method: "POST",
data:requestData,
headers: {
"accept": "application/json; odata=verbose",
"content-type": "application/json; odata=verbose"
success: function (data) {
$("#countItem").html("Pass");
error: function (data) {
$("#countItem").html("Fail");
Below is the responseText (log)
"{\"error\":{\"code\":\"-1, Microsoft.SharePoint.Client.ClientServiceException\",\"message\":{\"lang\":\"en-US\",\"value\":\"The HTTP method \'GET\' cannot be used to access
the resource \'GetItems\'. The operation type of the resource is specified as \'Default\'. Please use correct HTTP method to invoke the resource.\"}}}"
NavaneethFinally executed successfully using below code. The learning is we need to use type:"POST" instead of method:"POST"
function getListItems(term) {
var urltest = _spPageContextInfo.webAbsoluteUrl + "/_api/Web/lists/getByTitle('SampleList')/getitems(<Query><Where><BeginsWith><FieldRef">query=@v1)?@v1={\"ViewXml\":\"<View><Query><Where><BeginsWith><FieldRef
Name='Title'/><Value Type='Text'>" + term + "</Value></BeginsWith></Where></Query><RowLimit>1</RowLimit></View>\"}";
$.ajax({
url: urltest,
type: "POST",
headers: {
"X-RequestDigest": $("#__REQUESTDIGEST").val(),
"Accept": "application/json; odata=verbose",
"Content-Type": "application/json; odata=verbose"
contentType: 'application/json',
success: function (data) {
if (data.d.results.length != 1) {
$("#countItem").html("Pass");
$("#" + term).parent().parent().prop('disabled', true);
$("#" + term).removeAttr("onclick");
$("#" + term).css('cursor', 'default');
$("#" + term).parent().unbind("mouseenter mouseleave");
error: function (data) {
$("#countItem").html(urltest);
Navaneeth
Maybe you are looking for
-
I import a mini DV home movie .avi (720x480) When I play it with QT pro7, it looks wider than normal. My computer screen has the same aspect ratio of 3-2 but if I play the movie full screen with QT it shows 2 black horizontal bars at top and bottom,
-
Hierarchical structure to Flat Structure mapping in Message mapping
Hi Experts, I need to map the below hierarchical segments of SHPMNT03 IDOC XML to repitative stucture G_SHL of 857 EDI XML. Segments from IDoc. E1EDT20(Shipment) E1EDL20(Delivery) E1EDL24(Delivery Line Item) E1EDL44(IDoc: Handling Unit Item Deliv
-
Can't update email for iTunes account
I am having a hard time on updating my iTunes account info. I want to change my main email account but I am not allowed to verifie it
-
How to access the attributes in an object using TestStand.?
hi, I have a class named Status in C# that has 2 data members. There is another Class named Parameter and it has functions that return objects of type Status. I made the DLL of the class Parameter. Then i added that class to NI TestStand and called a
-
[Request] Uncomplicated Firewall
Hello, Ubuntu hardy introduces a new firewall ufw (Uncomplicated Firewall). It's a tool for host-based iptables firewall configuration. This tool should provide an easy to use interface to the user, as well as support package integration and dynamic-