JEditorPane - set http header

hi
how to set (or is it even possible) to set http header (in http request) in JEditorPane (to set referrer, user agent, etc.)
thanks a lot

Thanks Raja,
I am not an ITS expert by any means. I need help to work out how use the information in OSS Note 494984 to solve my problem.
The note seems to be about setting headers on all incoming requests to ITS.
I need to set the content-type header on an outgoing response generated using a specific (XML) template.
I did the BC440 course back in 2000 but after 2000 I never did another ITS project, focusing on Java and J2EE instead. So I am not sure how to apply what the OSS Note says. Do I need to assign the content type to a Business HTML parameter in the template? The documentation I have with SAP@Web Studio is not helpful.

Similar Messages

  • 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,

  • Setting HTTP header in soapMessage

    Hi,
    How can i set an specific HTTP header when using a SOAPConnection to send a SOAPMessage ?
    Please help,
    Pieter
    ps: it the Authorization header, so without it the other part won't accept my post !

    Pieterrr/ddossot
    I need to do the same thing. I have the code in place but it is still not adding the MimeHeaders to HTTPRequest object. I have the jxm-api.jar, and saaj-api.jar in my classpath.
    What am i doing wrong?
    This is my code
              try{
              // Create SOAP message
              MessageFactory factory = MessageFactory.newInstance();
              SOAPMessage message = factory.createMessage();
              // Create SOAP envelope
              SOAPPart soapPart = message.getSOAPPart();
              SOAPEnvelope envelope = soapPart.getEnvelope();
              SOAPHeader hh = envelope.getHeader();
              MimeHeaders headers = message.getMimeHeaders();
                        SOAPHeader     soapHeader = message.getSOAPHeader();
                        //headers.removeHeader("soapaction");
              headers.setHeader("soapction", "http://tempuri.org/GetData");
              String Hdr_Version_Name = "Version";
              String Hdr_Version_Value = "1.0";
              String Hdr_OnBehalfOf_Name = "OnBehalfOf";
              String Hdr_OnBehalfOf_Value = "";
              String Hdr_Role_Name = "Role";
              String Hdr_Role_Value = "1";
              String Hdr_EndPoint_Name = "EndPoint";
              String Hdr_EndPoint_Value = "001";
              String Hdr_ServiceId_Name = "ServiceId";
              String Hdr_ServiceId_Value = "001";
              String Hdr_DateTime_Name = "DateTime";
              String Hdr_DateTime_Value = "10/22/02";
              String Hdr_ClientApplication_Name = "ClientApplication";
              String Hdr_ClientApplication_Value = "APP001";
              String Hdr_TraceWebMethod_Name = "TraceWebMethod";
              String Hdr_TraceWebMethod_Value = "false";
              String Hdr_ClientTouchPoint_Name = "ClientTouchPoint";
              String Hdr_ClientTouchPoint_Value = "ClientTouchPoint";
              String Hdr_ChannelInfo_Name = "ChannelInfo";
              String Hdr_ChannelInfo_Value = "ChannelInfo";
              String Hdr_Environment_Name = "Environment";
              String Hdr_Environment_Value = "WINOS";
              String Hdr_USER_Name = "MUSER";
              String Hdr_USER_Value ="";
              String Hdr_SESSIONID_Name = "SESSIONID";
              String Hdr_SESSIONID_Value ="";
              String SAML_ASSERTION_Cookie_Name = "SAML_ASSERTION";
              String SAML_ASSERTION_Cookie_Value ="";
              String Hdr_tmsasessionticket_Name = "http_tmsamlsessionticket";
              String Hdr_tmsasessionticket_Value = token;
              headers.setHeader(Hdr_Version_Name,Hdr_Version_Value);
              headers.setHeader(Hdr_OnBehalfOf_Name,Hdr_OnBehalfOf_Value);
              headers.setHeader(Hdr_Role_Name,Hdr_Role_Value);
              headers.setHeader(Hdr_EndPoint_Name,Hdr_EndPoint_Value);
              headers.setHeader(Hdr_ServiceId_Name,Hdr_ServiceId_Value);
              headers.setHeader(Hdr_DateTime_Name,Hdr_DateTime_Value);
              headers.setHeader(Hdr_ClientApplication_Name,Hdr_ClientApplication_Value);
              headers.setHeader(Hdr_TraceWebMethod_Name,Hdr_TraceWebMethod_Value);
              headers.setHeader(Hdr_ClientTouchPoint_Name,Hdr_ClientTouchPoint_Value);
              headers.setHeader(Hdr_ChannelInfo_Name,Hdr_ChannelInfo_Value);
              headers.setHeader(Hdr_Environment_Name,Hdr_Environment_Value);
              headers.setHeader(Hdr_USER_Name,Hdr_USER_Value);
              headers.setHeader(Hdr_SESSIONID_Name,Hdr_SESSIONID_Value);
              // Necessary For Secure method
              headers.addHeader(Hdr_tmsasessionticket_Name, Hdr_tmsasessionticket_Value);
                   headers.addHeader("otc_header", "otcderiv");
              envelope.addNamespaceDeclaration("xsi","http://www.w3.org/2001/XMLSchema-instance");
              envelope.addNamespaceDeclaration("xsd","http://www.w3.org/2001/XMLSchema");
              envelope.addNamespaceDeclaration("soap","http://schemas.xmlsoap.org/soap/envelope/");
              boolean rem = envelope.removeNamespaceDeclaration("soapenv");
              SOAPBody body = envelope.getBody();
              soapPart.setContentId("");
              Name bodyName = envelope.createName("GetData", "", "http://tempuri.org/");
              SOAPBodyElement createuser = body.addBodyElement(bodyName);
              SOAPConnectionFactory scFactory = SOAPConnectionFactory.newInstance();
              message.saveChanges();
              SOAPConnection con = scFactory.createConnection();
              URL endpoint = new URL("http://abc.xyz.com/securitymanager.asmx");
              System.out.println("INPUT=" + envelope.toString());
              SOAPMessage responsex = con.call(message, endpoint);
              // print the response message
              ByteArrayOutputStream soapResponseStream = new ByteArrayOutputStream();
              responsex.writeTo(soapResponseStream);
              String sOutput = soapResponseStream.toString();
              //System.out.println("OUTPUT=" + sOutput);
              System.out.println(sOutput);
              }catch(Exception e)
              e.printStackTrace();
              }

  • Setting http header in as3

    hi all,
    I did face the similar issue and i cant set request headers
    in flash AS3. Actually i m trying to download file from S3 Amazon
    Bucket, which can only be allowed if custom header is set in a
    request. I m trying to set that but when I check the request
    Packets from Etheral or WireShark, the request doesnt contain any
    of mine custom header.
    here is my flash download code;
    var headers:Array = new Array();
    var authHeader:URLRequestHeader = new
    URLRequestHeader("Authorization","AWS: "+accesskey+":"+signature);
    var dateHeader:URLRequestHeader = new
    URLRequestHeader("x-amz-date",date);
    request.url = domainUrl+objectkey;
    request.method = URLRequestMethod.GET;
    headers.push(authHeader);
    headers.push(dateHeader);
    request.requestHeaders = headers;
    trace('request:'+request.requestHeaders.length);
    try {
    loader.load(request);
    }catch (error:Error) {
    trace("Unable to load requested document.");
    Remember I uploaded crossdomain.xml in the bucket with polies
    mentioned as under;
    <cross-domain-policy>
    <allow-access-from domain="*" secure="false" />
    <site-control permitted-cross-domain-policies="all"/>
    <allow-http-request-headers-from domain="*"
    headers="*"/>
    </cross-domain-policy>
    In order to download file from Amazon Bukcet the Request
    Packet should be;
    GET /<bucketname>/<filename>HTTP/1.1
    x-flash-version: 10,0,2,54
    User-Agent: Shockwave Flash
    Host: s3.amazonaws.com
    Authorization: AWS:<accesskey>:<signature>
    x-amz-date: <date>
    but after doing all the above work my final request sent to
    amazon;
    GET /<bucketname>/<filename>HTTP/1.1
    x-flash-version: 10,0,2,54
    User-Agent: Shockwave Flash
    Host: s3.amazonaws.com
    :( no custom header here;
    plz can anyone suggests
    Text

    Thanks alot Raymond for advice, it works, actually i tried
    with POST but without data. and now I came to know that Flash
    silently convert POST request to GET if no data is provided :).
    stupid Flash.
    but there is still a problem, as I mentioned that I am trying
    to retrieve files from S3 Amazon AWS data server which only allow
    GET request with custom header. and when I tried what you have
    suggested in the reply, Amazon gives Error in Response b/c the
    Signature which is used as a Key b/w the client and amazon server
    can only be created with GET request.
    Is there any possibility to send GET request from Flash with
    custom header b/c in my case, I need to send Http Request with GET
    method and along with custom header. :( Th Amazon doesn't accept it
    with POST.

  • HTTP Header in JSF

    Hello,
    How do I pass (or set) HTTP header to a JSF page?
    Thanks
    Message was edited by:
    skethama

    Try 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

  • Error in setting up HTTP Header Variable Authentication

    Hi,
    I am trying to set-up SSO for SAP Biller Direct aplication (deployed on SAP J2EE 7.0) using HTTP Header variable authentication.
    As per SAP documentation I have created a new login module "HeaderVariableLoginModule" pointing to class "com.sap.security.core.server.jaas.HeaderVariableLoginModule".
    Then I have added this new login module to Statck "Ticket" and the new config looks as below. HTTP header when UID is passed is USI_LOP.
    Name                                                                                Flag                                            Options
    com.sap.security.core.server.jaas.HeaderVariableLoginModule    Sufficient                                    ume.configuration.active= tue,
                                                                                    Header=USI_LOP
    BasicPasswordLoginModule                                                           Optional
    CreateTicketLoginModule                                                                 Optional                                         ume.configuration.active= tue
    EvaluateTicketLoginModule                                                              Sufficient                                      ume.configuration.active= tue
    The problem I am now having is that the authentication through HTTP_HEADEr does not work. Even though I ahve increased the trace level for JAAS module to debug, there is not any type of information generated in the log.
    Each time I call the Biller Direct URL from the extrenal web server which also passes the HEADER variable for Authntication, the authrisation just fails and I am being shown a Logon Screen to pust UID/PASSWORD.
    Can someone please guide me, how I can debug this? There is very no information whether anyone tried to login with HEADER varibale and that has failed...
    Also, I am not pretty sure whether I am using the right Authentication Stack, which is is Ticket in my case..
    But when I enter the application without any URL redirects and enter UID and password directly for Biller Direct, I get the following in log file, which makes me believe that I am using the right stack.
    LOGIN.OK
    User: CONDLG
    Authentication Stack: ticket
    Login Module                                                               Flag        Initialize  Login      Commit     Abort      Details
    1. com.sap.security.core.server.jaas.HeaderVariableLoginModule             SUFFICIENT  ok          false      false                
    2. com.sap.engine.services.security.server.jaas.BasicPasswordLoginModule   OPTIONAL    ok          true       true                 
    3. com.sap.security.core.server.jaas.CreateTicketLoginModule               OPTIONAL    ok          true       true                 
    4. com.sap.security.core.server.jaas.EvaluateTicketLoginModule             SUFFICIENT  ok          false      false                
    Central Checks                                                                                true                 
    Any help will be very much apprecated..
    Thanks,
    Vikrant Sud

    Vikrant,
    The reason why it is not working is because your login modules in ticket stack are in wrong order and with wrong flags. The first one should be EvaluateTicketLoginModule with flag=SUFFICIENT, then the Header Variable login module, with flag=OPTIONAL, then CreateTicketLoginModule with flag=SUFFICIENT, then BasicPasswordLoginModule with flag=REQUISITE, and lastly CreateTicektLoginModule with flag=OPTIONAL
    Thanks,
    Tim

  • How to Set UserId in Http Header for SSO?

    Hello All,
    I have a requirement to set the userid into the HTTP Header so that i can use the "Header Variables for User Authentication" module provided by SAP to achieve the SSO .
    Could some 1 let me know how can I achieve this? I know abt the HTTPServlet.setheader() method, But i need to set it using my JAVA application. Is there any way to set the HTTP Header using Java. I have already done a lot of googling, but havent got any results.
    I am sure that, there must definitely be a way in which we can add the user id into the HTTP header, in all the results, they tell abt adding it using the HTTP Servlet or PHP and so on, but i need to add it from JAVA.(setting REMOTE_USER as "mysapuserid")
    I have already added the "HeaderVariableLoginModule" in my login stack in the 2nd position, as per
    http://help.sap.com/saphelp_nw04/helpdata/en/8f/ae29411ab3db2be10000000a1550b0/frameset.htm
    Any pointers will be helpful,
    Meghana
    Edited by: Meghana Phadke on Apr 14, 2008 2:49 PM

    Hi
    As I understand, your java application is an EP client, check framework HttpClient :
    http://hc.apache.org/httpclient-3.x/
    http://hc.apache.org/httpclient-3.x/tutorial.html
    Hope this help
    Jakub Krecicki

  • Which OAM setting for passing values in HTTP header to application

    Experts, what is the setting in OAM 11gR2 that is set to pass a userid pulled from a LDAP directory (which is already configured with OAM) as a HTTP Header to an application.
    This is typically in cases where OAM is protecting or providing to protected resources on a Web Server or application.
    Is this setting (in OAM) by default set to userid? I wanted to know exactly where and how to set this value in OAM Console settings.

    In the protected resource policy and protected authorization policy in the responses tab set parameters to return headers for example if you want to return userid under name set header name like user_name, type header and the value as $user.userid. By default I guess OAM_REMOTE_USER is set in the http headers which contains the user id.

  • ESB requires "SOAPAction" to be set in HTTP header?

    I'm trying to insert an ESB flow between an existing web service and client. The service and client were previously built with Apache Axis.
    By generating an appropriate WSDL (doc/wrapped rather than Axis' default RPC style) for the existing service, I'm able to connect the ESB to the service.
    The problem is that the existing client (built using Axis) sets the SOAPAction in the HTTP header to empty (SOAPAction: ""), and the ESB appears to require this to be set to the desired operation. If this is a hard requirement, then I can't directly connect the existing client to the ESB flow.
    So, the question is whether it's possible to have the ESB relax the requirement for the SOAPAction header. And if so, how?
    If I can't get the ESB to accept SOAP requests with an empty SOAPAction, then I'll have to create a custom adapter or insert an additional proxy layer (yuk). Anyone else have any suggestions?

    This is all done automatically by FB.
    Just to try something out I just now made a simple app with a label only and tried to upload to Google... FAILED!!!!
    "Market requires versionCode to be set to a positive 32-bit integer in AndroidManifest.xml"
    LOL, FB can't even create this. :-/
    <?xml version="1.0" encoding="utf-8" standalone="no"?>
    <application xmlns="http://ns.adobe.com/air/application/3.1">
    <!-- Adobe AIR Application Descriptor File Template.
              Specifies parameters for identifying, installing, and launching AIR applications.
              xmlns - The Adobe AIR namespace: http://ns.adobe.com/air/application/3.1
                                  The last segment of the namespace specifies the version
                                  of the AIR runtime required for this application to run.
              minimumPatchLevel - The minimum patch level of the AIR runtime required to run
                                  the application. Optional.
    -->
    Message was edited by: KesherMedia.Com

  • Problem setting Unicode (utf-8) in http header using tomcat

    Hi:
    I am trying to set a file name in utf-8 to http header using the following code:
    response.setContentType("text/html; charset=utf-8");
    response.setHeader("Content-disposition", "attachment; filename=&#35299;&#27770;.zip");
    // I actually has file name in utf-8 here to set to the header, and I know that the name is correctly
    // and I also looked into the response object MimeHeaders object and saw the head is correctly there
    then write the content of zip file using ServletOutputStream.
    The problem I have is that the file name is not displayed correctly when prompted to save or open in the pop up window next. I found out using Fiddler that the request header is wrong:
    Content-disposition: attachment; filename=&#65533;zn&#65533;�.zip
    I am using Tomcat 5.0.28. Any idea how to get this working?
    Thanks in advance!

    You are setting the charset for the content to be UTF-8. (That is why the method is called setContentType.) But HTTP headers are not part of the content and so that has no effect on the header.
    The original specification for HTTP only allowed US-ASCII characters in headers. It is possible that more recent versions have features that allow for non-ASCII header data, but I don't know if that is the case or how you would use those features if they exist.

  • How to deal with the "Set-Cookie" field in HTTP header??

    I follow the RFC-2616 specification to write a socket program to fetch web pages.
    I have to deal with all the fields included in the HTTP header.
    But the RFC-2616 doesn't talk anything about the "Set-Cookie" field.
    Does anyone know how to handle this field or provide me any useful documentation.
    Any help is appreciated.

    A cookie is set with the "Set-Cookie: "-field in the http header, like this:
    Set-Cookie: mycookie=someValue
    This cookie should only be returned to the same host as it came from, like this in the http header of a request:
    Cookie: mycookie=someValue
    If the parameter looks like this:
    Set-Cookie: mycookie=someValue; path=/cgi-bin
    , the cookie should only be returned to the host if the request path starts with /cgi-bin
    If the parameter looks liek this:
    Set-Cookie: mycookie=someValue; domain=.mydomain.com
    , the cooke should be returned to all hosts in the .mydomain.com-domain
    There is also a "expires="-field, which works as expected and a "secure"-field, which I'm not sure how to handle. Maybe the cookie should only be sent to an SSL-enabled host?
    Hope this helps you. Bye,
    Dag W.

  • How to set custom HTTP header for single sign on

    Currently we just begin to use an application called "etran". This application requires user name and password to login. Now, my assignment is to integrate etran application in our internal application. This means that somewhere in our internal application, there is a link leads to the etran application.
    It is going to be single sign on, that means that once user logs into our internal application, when he/she clicks on the etran link, no sign on to etran is needed.
    I consult with the technical people in etran. they said that our internal application needs to send a "login request" to etran via SSL with the user's information encoded in base 64 format. etran captures the HTTP header containing user authentication and authorization information, and parses the required information from the HTTP header.
    My question is that how I set user information in HTTP header? From my understanding, once I am able to set the user information in HTTP header, it is in base 64 format?
    Thanks in advance for your help.

    sharon38_74 wrote:
    they said that our internal application needs to send a "login request" to etran via SSL with the user's information encoded in base 64 format. etran captures the HTTP header containing user authentication and authorization information, and parses the required information from the HTTP header.
    My question is that how I set user information in HTTP header? From my understanding, once I am able to set the user information in HTTP header, it is in base 64 format?Your application need to act like a proxy. You can invoke a HTTP request programmatically using java.net.URLConnection. You can set request headers using URLConnection#setRequestProperty(). Also see the API docs: [http://java.sun.com/javase/6/docs/api/java/net/URLConnection.html]. You only need to know the header field name where to set the Base64-encoded value in. You need to Base64-encode the value yourself.

  • Http header setting in servlet

    Hello,
    I want to set the header parameters of http response in my servlet.
    I set parameters as below:
              theResponse.setHeader("Request Version", "HTTP/1.1");
              theResponse.setStatus(200);
              theResponse.setHeader("Date", "Wed, 18 Apr 2007 09:24:04 GMT");
              theResponse.setHeader("Server", "Tomcat");
              theResponse.addCookie(theRequest.getCookies()[0]);
              theResponse.setHeader("pragma", "no-cache"); // HTTP 1.0
              theResponse.setHeader("Cache-Control", "no-cache"); // HTTP 1.1
              theResponse.setHeader("Expires", "Mon, 26 Jul 1997 05:00:00 GMT"); // a past date
              theResponse.setDateHeader("Last-Modified", (new java.util.Date()).getTime());
              theResponse.setHeader("Connection", "close");
              theResponse.setContentType("text/plain");
    //some other things...
              PrintWriter aPrintWriter = theResponse.getWriter();
              aPrintWriter.write("this is the string to be put into the body part of the http packet.");
    However, I am checking what I am sending as response using the ethereal network sniffing tool and seeing the result below:
    HTTP/1.1 200 OK\r\n
    Request Version: HTTP/1.1
    Response Code: 200
    Server: Apache-Coyote/1.1\r\n
    Content-Length: 68\r\n
    Date: Tue, 24 Apr 2007 17:55:10 GMT\r\n
    \r\n
    Data (68 bytes)
    I am setting header parameters as it should be.. But it doesn't care about my parameters and Tomcat puts some values that it selects..
    Where is my fault? Can anyone recommend sth please..? I am really stucked here..
    Thanks & Regards

    Hello,
    It looks like your question is really related to Tomcat (coyote). However if you want to control the server name on OC4J you can do it, see this blog entry:
    - OC4J tip: changing the server information
    Regards
    Tugdual Grall

  • OSB - Setting http Authorization header with Proxy Service

    Hi,
    I have the following scenario:
    PS1 -> PS2 -> BS (with a SA configured to pass through)
    I need to set the Authorization http header based on some information in payload, so:
    PS1 receives the payload and route to PS2, where username/password are extracted and using a java call out the base64 hash is generated.
    In the PS2 route i'm trying to set the Authorization header using the set Transport Headers option.
    When i do a request to test this operation, osb show me a beautiful CredentialNotFound exception.
    I have tryied to set the Authorization header in the route on the PS1, without success.
    Someone can help me ?

    I can't set the Proxy Service to do the authentication. I will try to explain better:
    I have a Business Service which have a Service Account associated to pass through the Authorization header to the service provider do the validation.
    I front of this business service i have a Proxy Service which route the requests to the BS.
    All partners send this Authorization header, but now, i have one that will not send no matter what.
    The username and passwrod will come into the payload (and will be variable).
    In some point before the proccess i need to extract the information from payload and set the Authorization header.
    Ty for you time.
    Edited by: GSanches on 09/07/2010 09:59

  • Can't set Authorization header in http message

    Perhaps someone can help me with a problem I'm having. I want
    to set an Authorization header in an HTTP request. From the
    documentation, I can set the "headers" attribute in the HTTPService
    element or I can use a <mx:headers> subelement. It is looking
    for an object or array. I hoping to set the header to look like:
    Authorization: GoogleLogin auth=1234abcd....
    When I use an object, it does not show at all. When I use an
    array of a single string, it includes the zero index of the array
    in the header something like:
    0: Authorization: GoogleLogin....
    Has anybody added custom headers to Http requests before?
    What am I missing?
    --Danny

    Perform for "idUserInteractionLevels" with a Google Site search in this site: http://www15.ocn.ne.jp/~preopen/iddom/domCS-CS3.html. You will get all sorts of questions answered if you are looking for InDesign help with VBScript. One of best sites with InDesign objects clearly documented.
    Hope this helps.
    I created a whole VBScript that will import XML and generate a PDF document in a interactive mode invlking this script from a Web Service.
    PRabhu

Maybe you are looking for