Hoiw do I get HTTP Header fields?
Hi,
I want to get the http header field If-None-Match. How do I get a hold of the HTTP headers for a request? I do not want to use If-Modified-Since due the the problems with out of synchronized clocks, determining time zones etc.
The content is in a BLOB, and I don't want to deliver it at all if not necessary. OWA_CACHE does not help, it still delivers the large amount of data.
I can set the ETag header, no problem, but how do I get theIf-None-Match header field returned from the browser so I can avoid unnecessary content delivery?
Thanks,
Larry
Is there a mod_plsql forum?
I can't seem to find it, this looked the closest since I am under the impression HTMLDB depends on mod_plsql...
Larry
Similar Messages
-
Get a specific Http header field from an http request in a component
Hello,
In a custom component that I've created ( which extends ServiceHandler), I'd like to access a specific http header field from the http requests that this component receives.
I assume this could be accessible through m_binder or m_service, but I didn't find any solution so far.
Any Idea?
Thanks in advance,
LeoAs it may help others, I answer what I figured out.
Every details of the http request is put into the m_binder.
So a specific field can be accessed with m_binder.getEnvironmentValue("My_data")
You can also list all the available data as it is a standard properties set. -
Any way to get HTTP header in web dynpro Java?
Is there any way to get HTTP header in web dynpro java? This method gives me the params. Is params same as header? It doesn't have any way to retrieve header data. I am on NW 7.0.19
WDProtocolAdapter.getProtocolAdapter().getRequestObject().getParameter("param");Dear Faraz,
I'm afraid the code you've pasted is only to retrieve URL parameters.
Have you tried this document to see if it offers any good hint:
[http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b0446f5c-fcb9-2910-e082-88becbe3ddc9]
Not sure if you can process the HTTP header with a WD4J.
An alternative could be to develop some Portal component in plain JAVA working as a proxy to call your WD4J afterwards.
That portal component would process your HTTP header and forward any parameter to your WD4J.
But this is me just guessing.
Kind Regards
/Ricardo -
HTTP Header fields in SOAP adapter - Part 2
Hi All,
With regards to my previous thread HTTP Header fields in SOAP adapter
my header issue is solved and hence I have closed the thread but still I am not able to make the connection successful. The new problem is below
My vendor requirement is to specify the header as "Ent-sender" but when we give the same in XI in communication channel it automatically convets into uppercase "ENT-SENDER". Due to case-sensitive in vendor server the connection is not gettingestablished.
Please help me out how to solve the problem.
<b>Note:</b> Sorry for the new thread as it was created due to new problem and also the previuos thread is already too long.
Regards,
DhillHi Neaves,
Thank you, I jave seen the note and find the below solution will be some what realated to my prblem.
<u><b>The nosoap mode lets the adapter send the XI payload directly without wrapping it in the SOAP envelope. Although the main use of this mode is to send some plain text content directly to some web server, one can use this mode to send their own SOAP message (e.g., with arbitrary headers) to an external web service (See related questions). In this case, the XI payload must be formatted in the SOAP envelope.
To use the nosoap mode, the channel must be configured to use no SOAP envelope.</b></u>
If yes, can you please let me know how to use nosoap mode otherise let me the other possibilities. I am already using tcpg2.zip to trace the SOAP adapter in which it was confirmed that XI is changing the header automatically into CAPS whatever case we give,
Regards,
Dhill -
How to add a user defined HTTP header field?
Hi, everyone!
I want to add a user defined HTTP header field to a HTTP
response header.
I use the following statements in testHeader.jsp
response.addHeader("myheader", "123");
response.sendRedirect("middleHeader.jsp");
in middleHeader.jsp,
out.print(request.getHeader("myheader"));
But the output in middleHeader.jsp is null!
How to add a user defined HTTP header field to a HTTP
response header? Are there some sample codes?
Cheers,
Georgethe send redirect actually creates a new request (through the client) and thus a new response
thus the headers you set in the response are gone for the next request/response
You can try servletDispatcher.forward -
Soap receiver - owerwrite default http header fields
Hi,
I'm using the soap receiver adapter in nosoap mode.
How can I owerwrite the default settings for the header fields in the http request?
The soap adapter will automatically set content-type = application/xml.
I would like for example set "text/xml".
Thanks,
BelaDear Mohan,
I tryed with the keep headers option but it didn't change anything to the HTTP header fields.
In the documentation we have the following : Keep Headers
If you want to include the header of the XI message in the Web service message, set the indicator.
Does it mean that I have to create a HTTP header section in the XI message??? Do you have an example?
Best regards,
Bela -
REG : HTTP header fields (Synchronous response)
Hi All,
Can anyone please explain the advantage of using this function in the receiver HTTP adapter( ie
"Set adapter specific message attribute -> HTTP header fields (Synchronous response)")
and how this can be implemented?
Thanks in Adavnce,
Siva>
sivarama krishna wrote:
> Hi All,
>
> Can anyone please explain the advantage of using this function in the receiver HTTP adapter( ie
> "Set adapter specific message attribute -> HTTP header fields (Synchronous response)")
> and how this can be implemented?
>
>
>
> Thanks in Adavnce,
> Siva
from help:
If you want to save HTTP header fields from the synchronous response in the XI message header, choose HTTP Header Fields (Synchronous Response) and enter the fields in the fields Field 1 to Field 6.
The fields must have the same names as the fields that are also to be sent in the HTTP response.
The technical names of the fields are HeaderFieldOne,...,HeaderFieldSix.
this means that in case you look to access the header of the response message of a sync http you can use this ASMA.
the implementation will be in your response mapping, using dynamic configuration - /people/shabarish.vijayakumar/blog/2009/03/26/dynamic-configuration-vs-variable-substitution--the-ultimate-battle-for-the-file-name -
How to set HTTP header field "cookie" with http receiver adapter?
Hi,
I am using http receiver adapter (not axis) in a scenario. I could not set a parameter with key cookie in http header. Is there some kind of restriction to set it? I am able to set others like connection and create custom fields using ASMA and dynamic key configuration via UDF on mapping.
Could you please comment on, is cookie http parameter special or noneditable by PI's http adapter? I am looking for a solution without editing any abap code...
Regards,I believe it is possible since axis adapter provides very same functionality. Let me summarize my scenario may be it helps:
I am trying to call series of webservice lets say in a BPM. First service (login service) will provide me with a session id (in http header with key Set-Cookie) then I will call another service which has that session id in its http header with key cookie then I am going to logout. So I am testing the second part now, but it doest let me send cookie http header parameter.
I hope I clarified a bit more my problem.
Regards, -
SOAP Sender Adatper - Read custom http header field
Hello,
i try to read a custom http header into the dynamic configuration of a message - but it is not working as expected - in ASMA i configured to get the value of MYHEADER1 into XHEADERNAME1 - when testing with a MYHEADER1 value, the value is not put into XHEADERNAME1.
Is it possible to get custom HTTP Headers in the message?
bf
franzI have quite the same problem!
I try to make the receiver determination based on the content of XHeaderName1, but none of the Dynamic Configuration parameters is shown in the sxi_monitor.
I've described my scenario in more detail in this thread
http://scn.sap.com/message/13586532#13586532
Does anyone have an idea? -
How to send a signed SOAP message with additional HTTP Header fields
Our Partner's integration requirements are that we send them asynchronous SOAP messages, that are digitally signed, and whose HTTP headers contains 5 or 6 additional header fields, of which 3 or 4 will need to be dynamically set during the message mapping. I believe we can use the HTTP adapter for adding new fields to the HTTP header, but don't believe it supports signing. I believe that the SOAP adapter supports signing, but I'm not clear on how to use it to add fields to the HTTP header. What is the most straight-forward way to achieve both the signing of the message and the addition of the HTTP header values?
Thanks,
Kurt>>>What is the most straight-forward way to achieve both the signing of the message and the addition of the HTTP header values?
Use Java mapping for both.
1) Signing the message
You can digitally sign the soap message using many standard api like WSS4j? or refer Java XML signature API which comes in Jdk1.6.
Refer these links
WSS4J - http://ws.apache.org/wss4j/axis.html
Java XML signature : http://java.sun.com/developer/technicalArticles/xml/dig_signature_api/
2) >>whose HTTP headers contains 5 or 6 additional header fields, of which 3 or 4 will need to be dynamically set during the message mapping
Use Dynamic configuration API to set the additional header fields during message mapping. -
Unable to get Http Header info in webservice Handler
Hi,
I have been trying to get the Header info in my custom Handler unsuccessfully
for the past few days.
Upon web search, I am constantly redirected to use a Servlet filter to get the
headers. I have to use the Weblogic Native SOAP engine and not any Servlet Filters.
In Axis, I can do a (HttpServletRequest)messageContext.getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST)
which returns the HttpServletRequest and then I can get the headers off that.
I can't find something similar in WebLogic. Any ideas?
Any help in helping me track this problem down would be much appreciated.
Thanks,
Sridhar.Yes, you are correct that you are taking a risk by using the "__BEA_PRIVATE_BINDING_PROP"
property, on the MessageContext object. The mechanism I provided is the recommended
(and supported) way to get the HTTP headers, as it only uses "documented" class.
Some developers think you are trying to "hide" something with undocumented classes,
but I don't think this is the case with BEA. There are good reasons and the point
you made about the likelihood of an unannouced future change breaking your code,
is probably pretty high on the list :-)
Getting the REMOTE_ADDR (or REMOTE_HOST) would most likely require the "undocumented"
approach you've taken. You could get the HttpServletRequest from this same HttpServerBinding
object, and call the getRemoteAddr() method on it. However, I really, really,
really think you should consult our "fantabulous" BEA support department, to see
if doing this will be supported.
Regards,
Mike Wooten
"Sridhar" <[email protected]> wrote:
>
Michael,
Thanks a bunch for your reply. I have been going crazy over this and
your reply
made my day.
I still have a slight problem with this though. This does not seem to
give me
the Client IP etc. Any ideas to get that?
Thanks again for the code. It was a great help.
Sridhar.
PS BTW, I found another way of getting the same info:
HttpServerBinding httpBinding = (HttpServerBinding) messageContext.getProperty("__BEA_PRIVATE_BINDING_PROP");
Enumeration headerEnum = httpBinding.getRequest().getHeaderNames();
while (headerEnum.hasMoreElements()) {
String header = (String) headerEnum.nextElement();
System.out.println("header = " + header);
System.out.println("header Value = " + httpBinding.getRequest().getHeader(header));
But, I am guessing BEA doesn't want me to go this route as they might
change the
implementation and my code will immediately break.
"Michael Wooten" <[email protected]> wrote:
Hi Sridhar,
You should be able to get at the HTTP Headers that were sent by theconsumer
of
your web service, by using the following code in your JAX-RPC handler:
import java.util.Iterator;
import javax.xml.rpc.handler.MessageContext;
import javax.xml.rpc.handler.soap.SOAPMessageContext;
import javax.xml.rpc.JAXRPCException;
import javax.xml.soap.MimeHeaders;
import javax.xml.soap.MimeHeader;
import javax.xml.soap.SOAPMessage;
public boolean handleRequest(MessageContext mc)
SOAPMessageContext messageContext = (SOAPMessageContext) mc;
try
SOAPMessage original = messageContext.getMessage();
MimeHeaders mimeheaders = original.getMimeHeaders();
MimeHeader mimeheader = null;
Iterator iter = mimeheaders.getAllHeaders();
for (; iter.hasNext();)
mimeheader = (MimeHeader) iter.next();
System.out.println("name=" + mimeheader.getName() + ", value="
+ mimeheader.getValue());
catch (Exception e)
e.printStackTrace();
throw new JAXRPCException(e);
Here's the output from the System.out.println():
name=Content-Type, value=text/xml
name=SOAPAction, value=""
name=User-Agent, value=Java1.4.1_05
name=Host, value=localhost:7001
name=Accept, value=text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
name=Connection, value=Keep-Alive
name=Content-Length, value=505
Regards,
Mike Wooten
"Sridhar" <[email protected]> wrote:
Hi,
I have been trying to get the Header info in my custom Handler unsuccessfully
for the past few days.
Upon web search, I am constantly redirected to use a Servlet filterto
get the
headers. I have to use the Weblogic Native SOAP engine and not any
Servlet
Filters.
In Axis, I can do a (HttpServletRequest)messageContext.getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST)
which returns the HttpServletRequest and then I can get the headersoff
that.
I can't find something similar in WebLogic. Any ideas?
Any help in helping me track this problem down would be much appreciated.
Thanks,
Sridhar. -
HTTP Header fields in SOAP adapter
Hi All,
I have a scenario IDoc to SOAP adapter. In which my receiver given the details as
URL : https://b2b.ecsc.us.gxs.com/invoke/GXSGateway:receiveCTE
Header Name: Header Value
Ent-sender xxxx
Ent-receiver yyyyy
Ent-APRF zzzzz
Ent-filename (not sure what data need to give)
1. I request you to let me know where I need to give these headername and hader values in soap adapter.
2. my client require file as an attachment. Please let me know how I need to send the payload as an file and where the name need to be given in the header name (Ent-filename).
Currently I used MessageTransformBean to conver my XML to text structure(flatfile structure).
Please let me know if any more details required
Regards,
DhillWas out for lunch break..
Juz Rechecking
Transport Protocol : HTTP
Message Protocol: Soap 1.1
Adapter Engine -> Adapter Engine on the Integration Server
Connection Parameters
Target URL - > https://b2b.ecsc.us.gxs.com/invoke/GXSGateway:receiveCTE
Sure about no sever authentication required and they are not using any HTTP proxy for webservice >????
Conversion Parameters
Do Not Use SOAP Envelope -> Unchecked
Keep Headers -> Checked.
Keep Attachments -> Unchecked
Use Encoded Headers -> Unchecked
Use Query String -> not so sure might be Unchecked
<b>Authentication Keys</b>
If authentication is required for the receiver system, you can enter a password and a confirmation for each key value. This means that you do not need to write passwords in the enhanced message header.
If you want to specify or display authentication keys, select View Authorization Keys.
You can enter and confirm passwords for each authentication key value (TAuthKey or TproyxAuthKey).
Try once sending the message with Adapter-Specific Message Attributes
Unchecked. See if there is a hit.I knw itz not req but juz testing.
Yeah adapter stat must be active.
Last thing need to go through the whole scenario.
<b>Cheers,
*RAJ*
*REWARD POINTS IF FOUND USEFULL*</b> -
Removing HTTP header field DOCTYPE in inbound HTTP
Hello,
For an inbound HTTP message we need to remove the !DOCTYPE tag from the message since XI message mapping cannot handle it.
We had a similar issue with outbound http where we used an xslt mapping to include the DOCTYPE.
I think it should be possible to also remove the doctype with xslt, in fact I have an xslt that works in xmlspy on the inbound http message, but after deploying in XI the mapping step fails.
The xslt is small but working:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:template match="/">
<xsl:copy-of select="." />
</xsl:template>
</xsl:stylesheet>
When I test the interface mapping it gives a transformer exception.
When i test the finished product I see the following in the monitor:
com/sap/xi/tf/_IF021_Ordrsp_TD_to_Ordrsp_CCS_com.sap.aii.utilxi.misc.api.BaseRuntimeExceptionFailed to load resource from the context classloa~
Since mapping works in external tools I'm not sure what the problem is for XI and how to solve it.
Another solution for this would seem to be a java mapping although i have no clue as to how to do this.
How to proceed?
Thanks
Tomupdate:
The solution lies in note 812966 which describes the problem above, and also gives an example java mapping program as example to get rid the DOCTYPE.
Regards
Tom -
Hai All,
Is there any option to add header fields dynamically in the HTTp adapter header fields?
I am doing a file to HTTp scenario.In this i have to pick a file using file adapter and add some header values(header values are both static and dynamic)and using HTTP adapter place it at a target URL.Is it possible to avoid mapping since there is only picking up of file and adding some headers to it.I can see header fields in the HTTP reseiver adapter.Can i use these to add the static and dynamiuc header fields.specifically i have two questions.
1)I want to include the source file name which is DYNAMIC as a field in the header fields in the target payload.How can this be achieved?Should i go for mapping and write a UDF for the same or is there any option to add dynamic values in the HTTP receiver adapter header fields?
2)what are these header fields for?
Can somebody explain it to me.I have gone through the Blogs like http receiver adapter configuration etc..would be of great help if anybody could explain it to me in detail.Thanks for the replies but my question is still un answered.please guide me on how to proceed?
I am going to send a txt file.On top of the contents of the file i want these headers to be attached
In the header fields of HTTP receiver adapter configuration can i give the following format?
Header Value
AS2 from: hgdfdjfhd
AS2 to: fhdfjdfdfnd
subject: hdsjdhsdsd
will it appear in the target file as
AS2 from: hgdfdjfhd
AS2 to: fhdfjdfdfnd
subject: hdsjdhsdsd
//file content starts here
dsgdsjfgdsfggf
hfdjhfdhfdjfdfhhdsfh
hgdsjfgdsjfgdfdgfdg
gfdsahdgsdfdgfgdsg
what is to be done for acheiving this kind of target file?
"If you choose to use HTTP Header fields then you can enter Field1 to Field 6 values. This will be embeded into the HTTP request as HeaderFieldOne and so on."
can this HeaderFieldOne to HeaderFieldsix be populated with any valueslike
AS2 from: ggdhfsdf and all?
please help me out. -
Browser modifies http accept header field set by applet
My problem: I have an applet which emulates a wml-browser. The applet is running in Internet Explorer 5. I can access all http-header fields from the applet and all settings made by the applet are honored.
But not the accept header-field... I can set it, but it is always modified afterwards by Internet Explorer or Netscape... It always include accept: text/html while it should only accept wml
Thanx in advance,
MarcoMy problem: I have an applet which emulates a
wml-browser. The applet is running in Internet
Explorer 5. I can access all http-header fields from
the applet and all settings made by the applet are
honored.
But not the accept header-field... I can set it, but
it is always modified afterwards by Internet Explorer
or Netscape... It always include accept: text/html
while it should only accept wml
Thanx in advance,
Marco
Question is ofcourse: How can I prevent this unwanted behaviour of the browser in which the applet is running?
Marco
Maybe you are looking for
-
How many apple tv can I connect with one account?
how many apple tv can I connect with one account?
-
Help with a "AT NEW" statement
I am debugging at some code and I am trying to understand the following statement <i>LOOP AT it_data_item_final INTO st_data_item_final. MOVE st_data_item_final-waers TO w_waers. <b>AT NEW xblnr."xblnr." budat xblnr waers.</b> MOVE-CORRESPONDIN
-
Enter at least one number for the business partner
Hi Experts, SRM 5 Classic scenario R/3 4.6c I am trying to execute users_gen transaction for integrating the user with the org. structure. However upon doing so I get an error message "Enter at least one number for the business partner" Please provid
-
Disconnecting and reconnecting via HTTPUrlConnection
Hi all, I'm writing a client program that connects to a server via HTTP with digest authentication. I extended the Authenticator class, registered it and I got connection with the server. No problems. Now, if I disconnect from the server and connect
-
I noticed an error with the finished iDVD disc of my movie. The camera shoots widescreen and the project is saved in widescreen and previews correctly in widescreen but my DVD player and TV play it as full screen and this crops off some of the titles