Parameters from HTTP header and HTTP parameter
All,
I am very new to APEX. Our new application needs to get two values, one from a HTTP header and the second from a HTTP parameter. I do not know how to do this. Is there an existing function like GET_HTTP_HEADER.val?
Thanks for any help.
Fred
user7183753 wrote:
Andy,
Thanks for the quick reply. The OWA_UTIL will give me static information.owa_util.get_cgi_env should be able to get any http header information that you require.
You can modify the dads.conf file to allow non-standard HTTP headers to be passed through, you add a PlsqlCGIEnvironmentList entry e.g.
PlsqlCGIEnvironmentList AuthorizedUser
If your users access an external URL to be authenticated and then that external system forwards to you with the new header showing the authenticated user name, you could pick up that 'AuthorizedUser' header as part of your own authentication mechanism.
Similar Messages
-
Http.get and http.post is now what under utl_http?
In previous source code sample(s), the statement http.get(url,response,content_type,proxyServer,proxyPort) doesn't exist in 9i. The sys.utl_http has get_Response but that doesn't take the same arguments. What is the utl_http call that would replace the http.get and http.post of 8i?
In short, POST requests are for sending any amount of data directly over the connection without changing the URL, and GET requests are for getting limited amounts of information appended to the URL.
POST requests cannot be bookmarked or emailed and do not change the Uniform Resource Locators (URL) of the response. GET requests can be bookmarked and emailed and add information to the URL of the response. -
Support for HTTP PUT and HTTP DELETE
Is there a plan for proper HTTP PUT and HTTP DELETE in Flash
Player and/or Flex? There's not much information on the subject at
this point. Is this going to be included in Flex 3? Is there an
issue I can track? etc.This is due to a limitation in the Flash Player so it will
not be available
in Flex 3.
Please continue to log enhancement requests against the Flash
Player here:
http://www.adobe.com/cfusion/mmform/index.cfm?name=wishform -
HTTP header and Filter: problem
Hi,
Let's suppose I need to check HTTP header values for some reason. I created a filter to analyze request information before passing it to servlet.
Anyway filter's method doFilter() takes a ServletRequest as a parameter, not HttpServletRequest, therefore I can't use HttpServletRequestWrapper and its method getHeaders(). ServletRequestWrapper does not have such a method. Casting from ServletRequest to HttpServletRequest won't work - Weblogic does not allow this.
Anyway I need to extract headers information for the request and I know for sure it is an HTTP request, of course.
Does anyone here know how can I extract header information in this case?Anyway filter's method doFilter() takes a
ServletRequest as a parameter, not
HttpServletRequest, therefore I can't use
HttpServletRequestWrapper and its method
getHeaders().However you are actually getting an HttpServletRequest object as your actual parameter, so just cast it to HttpServletRequest and do what you need to do. -
Editing HTTP header and body request and sending it...
Hi there!
I need to create a new Packet and send it to a server, its a HTTP protocol packet and all i need to do is insert the Header and Body information after sending it to the server..
does anyone know an example, link, book or anything about how to do it in j2se?
Thanks very much for any help, and sorry about my englishAnyway filter's method doFilter() takes a
ServletRequest as a parameter, not
HttpServletRequest, therefore I can't use
HttpServletRequestWrapper and its method
getHeaders().However you are actually getting an HttpServletRequest object as your actual parameter, so just cast it to HttpServletRequest and do what you need to do. -
User-defined http header and com.oracle.httpclient.HttpRequestBuilder
Hello,
In Java ME Embedded 8, I would like to send a HTTP request containing a user-defined identifier in the http header (X- header type), using the com.oracle.httpclient package.
HttpClient client = clientBuilder.build();
HttpRequestBuilder requestBuilder = client.build(http://my_uri);
requestBuilder.setHeader(HttpHeader.ACCEPT, "text/plain");
Here, I would like to add a user-defined header value like :
requestBuilder.setHeader("MyHeader", "myHeaderValue");
It seems that there are only pre-defined values available for headers in the com.oracle.httpclient.HttpHeader class.
Is there any way to add a user-defined header in the request ?
Thanks in advance.
BrunoHi Bruno,
did you try HttpHeader myHeader = new HttpHeader("MyHeader");?
/Sergey -
How to receive parameters from a form and insert values in db using servlet
Hi friends,
My first question here.
I'm trying to create a Servlet that takes input from a form and process it and insert it in database.tablename.
My MAIN ISSUE IS WITH THE NUMBER OF COLUMNS THAT WOULD BE DYNAMIC AND THUS CANT RECEIVE THE PARAMETERS IN STATIC CODE.
Here is the form code
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<form action="Test" method="post" />
<table width="90%" border="1" cellspacing="1" cellpadding="1">
<tr>
<th scope="col">Student Name</th>
<th scope="col">RollNo</th>
<th scope="col">Java</th>
<th scope="col">J2ee</th>
</tr>
<tr>
<td><input type="text" name="studentname" /></td>
<td><input type="text" name="rollno" /></td>
<td><input type="text" name="java" /></td>
<td><input type="text" name="j2ee" /></td>
</tr>
<tr>
<td><input type="text" name="studentname" /></td>
<td><input type="text" name="rollno" /></td>
<td><input type="text" name="java" /></td>
<td><input type="text" name="j2ee" /></td>
</tr>
<tr>
<td><input type="text" name="studentname" /></td>
<td><input type="text" name="rollno" /></td>
<td><input type="text" name="java" /></td>
<td><input type="text" name="j2ee" /></td>
</tr>
</table>
<input type ="submit" value="insert values in the database now"/>
</form>
</html>
And here is the Servlet
import javax.servlet.*;
import javax.servlet.http.*;
import java.sql.*;
import java.io.*;
public class Test extends HttpServlet {
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter out = response.getWriter();
String title = "Module: Process Result Values from previous page";
out.println("<html>\n" +
"<head><title>" + title + "</title></head>\n" +
"<body>");
try
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/","root", "root");
Statement s = con.createStatement();
ResultSet res = s.executeQuery("SELECT * FROM dbname.tablename");
ResultSetMetaData rmeta=res.getMetaData();
int noofcolumns=rmeta.getColumnCount();
if(!con.isClosed())
catch(Exception e)
System.out.println("Exception"+e);
out.println(e);
if(connectionFlag==1)
out.println("</body></html>");
doGet(request, response);
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
This is the basic code structure and I'm trying to figure out this special case with handling the multiple parameters:
1. I dont' want to use String []a=request.getParameterValues("studentname"); as hard code. The reason being the number of rows will be diyamic and I would like to get the column name and then then use an array of string to take values. But how can I connect these to form a query so that the rows goes on inserted one after other.
Thanks,
MashallThank you for your help.
I'm something close to it but this segment of code throws a NullPointerException Error. I counted number of rows and columns using the methods getColumnCount() and getColumnName(i).
ResultSetMetaData md = res.getMetaData(); //Get meta data for the resultset
int noofcolumns=md.getColumnCount();
out.println("<br />Number of columns in table (including name and roll number) :::: "+noofcolumns+"<br />");
for(int i=1;i<=noofcolumns;i++) // access column 1....n
String columnname = md.getColumnName(i); // get name of column 1....n
out.println("<br />Current column name ::: "+columnname+"<br />"); //check if the name appear correct.
String []columndata = request.getParameterValues(columnname); //Get raw value in array
for(int j=1;j<=rows;j++) // here rows is number of rows in each column
out.println("To be inserted: <b>"+columndata[j]+"</b> in Row ::: "+j+"<br />");
//The line above thows null pointer exception.
} -
Accessing parameters from request header in init()
Hello
How can I access parameters passed on the client request header like
http://localhost:8080/servlet/DBServlet?database=mydatabase
from the servlet initialization method ini()
The getInitParameter() only returns parameters defined in the web.xml file (if is this correct).
I would like to use the getParameter() from the request class, how can I do this within init()
ThanksGreetings,
Hello
How can I access parameters passed on the client
request header like
http://localhost:8080/servlet/DBServlet?database=mydat
base
from the servlet initialization method ini()You can not. As you pointed out, the init() method is for servlet initialization - it is called by the container to allow the servlet to prepare to receive requests, which are then passed to the service() method.
The getInitParameter() only returns parameters defined
in the web.xml file (if is this correct). That is correct - parameters can be defined in the deployment descriptor in either the <servlet> level (passed to the servlet in ServletConfig), or the <webapp> level (passed to the entire webapp in ServletContext).
I would like to use the getParameter() from the
request class, how can I do this within init()Again, you can not - there simply is not any client communication during initialization.
ThanksRegards,
Tony "Vee Schade" Cook -
No "Remote-User" in HTTP header when HTTP request gets to WLS
Hello Exprers,
I have a customer, using 10.3.3 on Linux machine. Web server as Apache.
He wants Remote-User in HTTP header, he used to get it when he used Tomcat. But when he transffered to Apache and 10.3.3, he is not getting the Remote-User in header, instead he is getting proxy-remote-user.
He wants the Remote-user in HTTP header.
Any clue, on why he is not getting it.Hi,
We are facing error while doing openConnection
When I tried with simple java file it worked as shown below
import java.io.*;
import javax.net.ssl.HttpsURLConnection;
public class test
public static void main(String[] args) throws Exception
String httpsURL = "https://rcfe.aspac.citicorp.com:40054/servlet/Verify";
URL myurl = new URL(httpsURL);
HttpsURLConnection con = (HttpsURLConnection)myurl.openConnection();
InputStream ins = con.getInputStream();
InputStreamReader isr = new InputStreamReader(ins);
BufferedReader in = new BufferedReader(isr);
if (con!=null)
System.out.println("con="+con);
System.out.println(ins);
Output*
[rcrrgbg2@kauh0079:/rcrmap2/weblogic/bea/ORA_PFRD/forms/j2ee] java test
con=com.ibm.net.ssl.www2.protocol.https.e:https://rcfe.aspac.citicorp.com:40054/servlet/Verify
sun.net.www.protocol.http.HttpURLConnection$HttpInputStream@5f6c5f6c
However when I tried with below program I am able to write upto Web CL URL but after that no log is written when it tries to do openConnection() for this line csConn=(HttpsURLConnection)new URL(webclURL).openConnection(); in the below code
Some part of the code:_
=======================================================================
import java.io.*;
import javax.servlet.http.*;
import javax.servlet.*;
import java.util.Hashtable;
import java.io.File;
import java.io.FileInputStream;
import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.net.ssl.HttpsURLConnection;
import java.net.URL;
public class CRMSLogin extends HttpServlet
private static final long serialVersionUID=-6294676216324813290L;
public void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException
String iniFile=request.getParameter("CRMS_INI_FILE_PATH");
String sessionId=request.getParameter("SessionId");
String applId=request.getParameter("apl_id");
String userId=request.getParameter("userId");
String clientIp=request.getRemoteAddr();
Properties iniProp=this.getProperties(iniFile);
String crmsAppServerContext=iniProp.getProperty("CRMS_APP_SERVER_CONTEXT");
String appModule=iniProp.getProperty("CRMS_MODULE");
String webclURL=iniProp.getProperty("WEBCL_URL");
// HttpsURLConnection csConn=null;
String crmsFormsTerm=null;
crmsFormsTerm=getEntitlements(iniFile.trim(),sessionId,applId.trim(),clientIp.trim(),webclURL.trim());
String baseContent=this.getBaseContent(iniProp);
ServletOutputStream out=response.getOutputStream();
baseContent=baseContent.replaceAll("<!APP_TITLE!>","Credit Risk Management System");
baseContent=baseContent.replaceAll("<!APP_CONTEXT!>",crmsAppServerContext);
baseContent=baseContent.replaceAll("<!APP_MODULE!>",appModule);
baseContent=baseContent.replaceAll("<!APP_TRACE!>",crmsFormsTerm.replaceAll(" ", ""));
baseContent=baseContent.replaceAll("<!USER_ID!>",userId);
baseContent=baseContent.replaceAll("<!SESSION_ID!>",sessionId);
baseContent=baseContent.replaceAll("<!APPL_ID!>",applId.trim());
baseContent=baseContent.replaceAll("<!CLIENT_IP!>",clientIp.trim());
baseContent=baseContent.replaceAll("<!INI_FILE!>",iniFile.trim());
out.println(baseContent);
out.flush();
out.close();
private synchronized Properties getProperties(String inifile)
Properties iniProp=new Properties();
FileInputStream iniFileStream=null;
try
iniFileStream=new FileInputStream(inifile);
iniProp.load(iniFileStream);
iniFileStream.close();
catch(Exception e)
finally
try
if(iniFileStream!=null)
iniFileStream.close();
catch(Exception e)
return iniProp;
public static synchronized String getEntitlements(String inifile,String sessionId,String applId,String clientIp,String webclURL)
HttpsURLConnection csConn=null;
OutputStreamWriter requestStream=null;
BufferedReader responseStream=null;
StringBuffer responseData=new StringBuffer();
String csReturnString=null;
//String webclURL=null;
BufferedWriter traceLog=null;
int csCount=6;
Properties iniProp=new Properties();
String traceFile=null;
String entitlementData=null;
try
readIniProperties(inifile,iniProp);
traceFile=getTraceFile(iniProp);
traceLog=new BufferedWriter(new FileWriter(traceFile,true));
if(traceFile!=null)
traceLog.write("###########################");
traceLog.write("P A R A M E T E R S");
traceLog.write("###########################");
traceLog.newLine();
traceLog.write("INI_FILE:"+inifile);
traceLog.newLine();
traceLog.write("SESSION_ID:"+sessionId);
traceLog.newLine();
traceLog.write("APPL_ID:"+applId);
traceLog.newLine();
traceLog.write("CLIENT_IP:"+clientIp);
traceLog.newLine();
traceLog.write("count:"+csCount);
traceLog.newLine();
traceLog.write("###########################");
traceLog.newLine();
//webclURL=getWebclURL(traceLog,iniProp);
if(webclURL!=null)
traceLog.write("Web CL URL:"+webclURL);
traceLog.newLine();
csConn=(HttpsURLConnection)new URL(webclURL).openConnection();
traceLog.write("Open Connection - Completed!");
traceLog.newLine();
csConn.setRequestMethod("POST");
csConn.setDoInput(true);
csConn.setDoOutput(true);
requestStream=new OutputStreamWriter(csConn.getOutputStream());
traceLog.write("Open Request Stream - Completed!");
traceLog.newLine();
requestStream.write("SessionId="+sessionId+"&ClientIP="+clientIp+"&apl_id="+applId+"&count="+csCount);
requestStream.flush();
requestStream.close();
traceLog.write("Write Params to Request Stream - Completed!");
traceLog.newLine();
responseStream=new BufferedReader(new InputStreamReader(csConn.getInputStream()));
traceLog.write("Open Response Stream - Completed!");
traceLog.newLine();
while((csReturnString=responseStream.readLine())!=null)
responseData.append(csReturnString);
traceLog.write("Response Stream Reading - Completed!");
traceLog.newLine();
responseStream.close();
csConn.disconnect();
entitlementData=getEntitlementData(traceLog,responseData.toString(),iniProp);
traceLog.write("responseData::"+responseData);
traceLog.newLine();
traceLog.newLine();
traceLog.write("entitlementData::"+entitlementData);
traceLog.newLine();
traceLog.flush();
traceLog.close();
catch(Exception e)
e.printStackTrace();
finally
try
if(requestStream!=null)
requestStream.close();
=======================================================================
output_
###########################P A R A M E T E R S###########################
INI_FILE:/rcrmap1/rcrrgbg2/crms.ini
SESSION_ID:%2526%253ASIGNED_TICKET%253D%2526PROVIDER_TICKET%253D002c6e4cH0tZy2Gj4JBCOiSL7uSlKisfsqgwP9KoRRn7e%252BY%253D%253AKRSERVER0006%252BA9A52AAE%252B4D1DC7AA%252B14400
APPL_ID:RCRMKR
CLIENT_IP:169.165.42.174
count:6
Web CL URL:https://rcfe.aspac.citicorp.com:40054/servlet/Verify
Please help to guide us.
Regards,
Harish -
Does GSS HTTP-HEAD supports https?
I am configuring a GSS to check an Web server that responds to https requests.
I put 443 as the port but I don´t see replies from the server and the Answer Status is always offline.
Other servers using http on port 80 are showing OK.
The appliance is a GSS-4492-k9 Version 3.1(0).Hi,
https keepalive was introduced recently and is available as of version 3.2(0).
http://www.cisco.com/en/US/docs/app_ntwk_services/data_center_app_services/gss4400series/v3.2/release/note/GSSRN32.html#wp296321
hope this helps,
Fabrizio -
i have a HTTP request--->BPM--->Http Response, there is a S/A bridge to implement this
for which i there is a
1. HTTP sender channel (outbound synchronous message interface),
2. BPM,
the requirement is...in the sync HTTP response, i need the HTTP header "content-length"to be changed to 0,
for this i wanted to use the "Set adapter specific message attribute -> HTTP header fields (Synchronous response)" in the HTTP sender channel,
but i cant see this field in the sxi_monitor in the Dynamic configuration tab of the Response Message...
pls help me solving thisTry this
[http://help.sap.com/saphelp_nw04/helpdata/en/43/64dbb0af9f30b4e10000000a11466f/content.htm|http://help.sap.com/saphelp_nw04/helpdata/en/43/64dbb0af9f30b4e10000000a11466f/content.htm]
Also the Stream Transformation Constants which we can access using Dynamic Configuration:
[http://help.sap.com/javadocs/NW04S/current/pi/com/sap/aii/mapping/api/StreamTransformationConstants.html|http://help.sap.com/javadocs/NW04S/current/pi/com/sap/aii/mapping/api/StreamTransformationConstants.html]
Edited by: Praveen Gujjeti on Apr 21, 2009 12:24 PM -
HTTP Sender and HTTP Receiver .Pls advice urgent
Hi All,
Partner A (http) -- XI -
Partner B(http)
Now Trade Partner do not want to use HTTP client tool.
He wants to send data through URL.
Please make the full sender URL for the details below
for Sender HTTP:
XI system -- sapd0aa
Client -- 100
Port -- 8000
Sender Service -- SS
Sender Interface -- SI
Sender Namespace -- http:
abc
Qos -- EO
In Receiver HTTP Aadapter if I use RFC Destination does it has to be of Type G
RegardsHi Henry,
1. Where sender partner will send his XML if he uses the above URL?
Whatever technology , partner is using to send the data, there are some APIs available for establishing the http connection and then sending the data on this HTTP connection.
2. How the user name and password will be sent in the above URL as XI requires User Name and password.
You can embed in the URL by adding sap-user=xyz&sap-password=abc
Piyush -
Reading DLL function and parameters from a header file
Hallo to everyone,
I am trying to find a cute wayHello,
I think this is what you were asking in another stream. I don't think there is a way to do that. For examples of passing data to dlls given the naming convention variation across environments, check out the shipping example named Call DLL.vi, which will open other examples of using call library function nodes with a datatype you specify.
I hope this helps, and these suggestions are very welcome at our feedback site - click Contact NI at ni.com, and then the word "feedback" in the lower left corner to submit a product suggestion.
Best Regards,
JLS
Best,
JLS
Sixclear -
OSB call to remote Web Service via https proxy and https CONNECT problem
Hi
I have a service that calls a web service on another server as a web service. This call is via https and the certificate validation raises no errors.
I now want this call to go via a squid httpd proxy on port 3128 on some machine. So I would like to use HTTP CONNECT (RFC 2817) proxying,. But when I set up this as a proxy, I am getting "Certificate chain" error messages. The certifcate chains is no different now from when I called without the http proxy, so what am I doing wrong? Does OSB support HTTP CONNECT?
-JohanThe exeption we are getting is BEA-380000
General runtime error: [Security:090477]Certificate chain received from XXX - 123.123.123.123 --> test.salesforce.com was not trusted causing SSL handshake failure.
This is of course not relevant if the callout were using CONNECT. In the CONNECT scenario, OSB would not care about XXX's certificate. -
HTTP Sender and HTTP Receiver adapter. Pls advice urgent
Hi All,
There is one Third Party that wants to send XML data and receive XML data with XI.
Please let me know can I use HTTP for that.
How to use HTTP Sender part?
How to use HTTP Receiver Adapter?
Pls send blogs/doc for that
Thanks and Regardshi.,
Check this thread for the code for a HTTP Client,
/message/266750#266750 [original link is broken]
Also, check these blogs. They use HTTP adapters for their configuration,
/people/siva.maranani/blog/2005/05/21/jdbc-stored-procedures
/people/sriram.vasudevan3/blog/2005/02/14/calling-stored-procs-in-maxdb-using-sap-xi
http://help.sap.com/saphelp_nw04/helpdata/en/44/79973cc73af456e10000000a114084/content.htm
Check these links for the configuration part.
http://help.sap.com/saphelp_nw04/helpdata/en/43/64db4daf9f30b4e10000000a11466f/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/44/79973cc73af456e10000000a114084/content.htm
Weblog :
/people/sriram.vasudevan3/blog/2005/01/11/demonstrating-use-of-synchronous-asynchronous-bridge-to-integrate-synchronous-and-asynchronous-systems-using-ccbpm-in-sap-xi - although this weblog is
aimed at explaining the sync-async bridge.. Sriram has taken http-to-file scenario as the example
note:reward points if solution found helpfull.....
regards
chandrakanth.k
Maybe you are looking for
-
Ical iOS Lion, month preview / change style
Hi, I am wondering how to display the preview of the months to come in the left side of the new iCal, like it was possible before in weekly view. I really miss this functionality, as I need to have a good idea of the months to come to manage many of
-
The search bar stays at the top of my computer screen at all times. It runs the full lengh of the screen, has the mozilla logo on the far left then the search bar and a facebook, Wikipedia, youtube and amazon icon.
-
i have microsoft xp pro 2003 service pac 3. when i am in an excell file with the file open, i often want to convert the file to a pdf and send as an attachment in an email. this worked find for a couple of weeks after installing adobe 6. suddenly, no
-
When I'm using Photoshop, the workspace flickers on and off, from dark grey to none, this aslo includes the image I'm working on. Which, needless to say, makes it very hard to do anything. Does anyone know how I can fix/negate this? Windows 8 and Pho
-
While trying to purchase an app from the app store it directs me to verifying my billing information and after entering all the inforamtion when I get to entering my address it does not give me the option to select a Canadian postal code or province.