Https and request.getScheme()

I have Apache and Jrun 3.1.
When I'm in https and I run request.getScheme(), I get http instead of https.
From HttpUtils.getRequestURL(request) I get a string beginning with http:// but containing the correct https port (443).
I was using Jrun's BASIC authentication with https without problems. Now I'm trying their FORM authentication and as soon as I give username and password it bumps me out of https into http.
Any ideas?

hi
i am also facing same problem.
i am using tomcat with apache
if you found any solution then
please reply
Rajan

Similar Messages

  • Switching between https and http requests

    Hi,
    Our application is built using ADF 10.1.3
    This application need to be integrated with an in house built single sign on system. ( SSO system is built in C# and .NET)
    This single sign on system only understand https request. Once user is validated against single sign on system, our application's authorization page is called in HTTPS mode. Once the user is authorized, he is forwarded to home page. While forwarding to home page, we want to convert the HTTPS request to HTTP.
    Currently once the user is authenticated, all requests are happening in HTTPS mode.
    We do not know how to make http request from existing https requested page.
    Any help is appreciated.
    Thanks
    Ranajit

    Hi,
    the way to do this is by redirecting the call from a PhaseListener or command button. The solution Avrom refers to is a PhaseListener that uses XML configuration file to determine whether or not the page you are navigating to requires https or http. The code that handles the protocol switch is printed below
      * Determines if the requested page requires SSL and if the current protocol
      * meets this need. If not the protocol is switched between http and https
      * @param viewId
      * @param pageRequiresSSL
      public void handleProtocolSwitch(String viewId, boolean pageRequiresSSL)
        ExternalContext exctx = FacesContext.getCurrentInstance().getExternalContext();
        boolean isSecureSSLChannel = ((HttpServletRequest)exctx.getRequest()).isSecure();
        // pages that require SSL and SSL is on, or pages that don't require
        // SSL but SSL is on and should be kept
        if (pageRequiresSSL && isSecureSSLChannel || !pageRequiresSSL && isSecureSSLChannel && isKeepSSLMode) {
        printDebugMessage("Page requires SSL = "+pageRequiresSSL+", channel is secure = "+isSecureSSLChannel+", is keep SSL = "+isKeepSSLMode);
        printDebugMessage("No protocol change required");
        // page requires SSL and SSL is not active. Switch to SSL.
        if (pageRequiresSSL && !isSecureSSLChannel) {
          printDebugMessage("Page requires SSL = "+pageRequiresSSL+", channel is secure = "+isSecureSSLChannel);
          printDebugMessage("Protocol change required to use https");
          switchToHttps(viewId);
        // switch to HTTP is page doesn't require SSL and channel isn't secure
        // and isKeepSSLMode is false
        if (!pageRequiresSSL && !isKeepSSLMode && isSecureSSLChannel) {
          printDebugMessage("Page requires SSL = "+pageRequiresSSL+", channel is secure = "+isSecureSSLChannel+", is keep SSL = "+isKeepSSLMode);
          printDebugMessage("Protocol change required to use http");
          switchToHttp(viewId);
        if (!pageRequiresSSL && !isSecureSSLChannel) {
          printDebugMessage("Page requires SSL = "+pageRequiresSSL+", channel is secure = "+isSecureSSLChannel);
          printDebugMessage("No protocol change required");
      * Switches from https to http using a redirect call
      * @param viewId
      private void switchToHttp(String viewId) {
          FacesContext facesContext = FacesContext.getCurrentInstance();
          ExternalContext exctx = facesContext.getExternalContext();
          ViewHandler vh = facesContext.getApplication().getViewHandler();
          String pageURI = vh.getActionURL(FacesContext.getCurrentInstance(), viewId);
          //redirect to http URL
          String remoteHost = getHostNameFromRequest();
          printDebugMessage("Switch to http on host "+ remoteHost);
          try {
              String port = httpPort.equalsIgnoreCase("80") ? "" : ":" + httpPort;
              String url = "http://" + remoteHost + port + pageURI;
              printDebugMessage("Redirecting to http URL "+ url); 
              //TODO check request Map
               this.printDebugMessage(" Content size of RequestMap before redirect "+exctx.getRequestMap().size());
              exctx.redirect(url);         
          } catch (IOException e) {
              printDebugMessage("Redirect to http port failed "+ e.getMessage());
      * switches to https using a redirect call
      * @param viewId
      private void switchToHttps(String viewId) {
          FacesContext facesContext = FacesContext.getCurrentInstance();
          ExternalContext exctx = facesContext.getExternalContext();
          ViewHandler vh = facesContext.getApplication().getViewHandler();
          String pageURI = vh.getActionURL(FacesContext.getCurrentInstance(), viewId);
          //redirect to https URL
          String remoteHost = getHostNameFromRequest();
          printDebugMessage("Switch to SLL/https on host "+ remoteHost);
          try {
              String port = httpsPort.equalsIgnoreCase("443") ? "" : ":" + httpsPort;
              String url = "https://" + remoteHost + port + pageURI;
              printDebugMessage("Redirecting to https URL "+ url);       
              //TODO check request Map
              this.printDebugMessage(" Content of RequestMap before redirect "+exctx.getRequestMap().size());
              exctx.redirect(url);         
          } catch (Exception e) {
              printDebugMessage("Redirect to http port failed "+ e.getMessage());
      * @return the hostname of the page request
      private String getHostNameFromRequest() {
          ExternalContext exctx = FacesContext.getCurrentInstance().getExternalContext();
          String requestUrlString = ((HttpServletRequest)exctx.getRequest()).getRequestURL().toString();
          URL requestUrl = null;
          try {
              requestUrl = new URL(requestUrlString);
          } catch (MalformedURLException e) {
              e.printStackTrace();
          String remoteHost = requestUrl.getHost();
          return remoteHost;
      }If your container doesn't support session sharing between http and https then the session is renewed. In OC4J you will have to configure this.
    Frank

  • Logging HTTP and/or SOAP packets in standalong OC4J v10.1.3.2

    I'm running OC4J standalone v10.1.3.2 on RH5 linux. I'd like to know how to turn on logging so that all incoming HTTP data can be viewed.
    I've basically got a Web Service which is failing to execute from some clients (but not all) due to a SOAP11 version mismatch problem. If I could see the incoming HTTP and/or SOAP request then I could determine where the inconsistency is coming from.
    Here's an extract of the returned SOAP error:
    <faultcode>env:VersionMismatch</faultcode>
    <faultstring>Version Mismatch</faultstring>
    <faultactor>http://schemas.xmlsoap.org/soap/actor/next</faultactor>
    I've tried editing j2ee-logging.xml and set the logging level to FINEST and TRACE but it's still not logging out the HTTP traffic.
    Any ideas welcomed,
    Thanks

    Andy,
    Which log files are you looking at? There is a server.log that will be impacted when you set the logging level to FINEST. Since you want to look at http requests, have you considered using Fiddler on the client side? It's pretty verbose but you can see all sorts of info including data posted to forms.
    -Michael
    PS
    URL:
    http://www.oracle.com/technology/tech/java/oc4j/htdocs/oc4j-logging-debugging-technote.htmlTake a look at the "Debug Options in OC4J" section. There are several HTTP debugging options listed.
    Edited by: Michael F. Hardy on Dec 17, 2008 9:40 AM

  • Using ADFS authentication to perform SSO via HTTP GET request

    Hi,
    Can i authenticate users (those users are clients, at home) to a web application using ADFS without SAML tokens?
    The situation is that i want the clients to perform SSO to the website via a link they receive in their mailboxes. 
    I thought about a solution that combines JWT in a URL link that each user will get to his private mail. this link will contain the users' claim (such as ID Num, given from AD DS Server dedicated especially for them).
    Thus, the user will receive an email with a link that already contains a short period of time JWT to perform SSO to the webapp.
    Is it possible ? anybody heard about a similar solution ?

    Sandra
    Thanks for your message
    Here is the my requirment
    The basic flow of a Where 2 Get It REST API call is:
    1) create the required XML structure,
    2) URI encode it,
    3) make a HTTP GET request,
    4) then parse the return XML document.
    Currently i have some data in ABAP structure with 5 fields, i need to create XML from the those 5 fields,and needs to be URI
    encode it, and then needs to make a HTTP get request to connect Where to Get It REST API, finally it will return XML document via HTTP Get request , and then needs to convert the return XML to  ABAP structure for further processing .the above 4 points will be implemented in my report.
    Any  body could help on this

  • Retrieve data/files fro HTTP POST request in On-Demand process

    Hello,
    I would like to integrate https://github.com/blueimp/jQuery-File-Upload to my APEX 4.2 application inside XE11g. I would like to use this kind of jQuery component, multiple file upload, use Drag & Drop, image resize, size limit, filter extensions etc...
    This jQuery component and also others javascript uploaders sends data files to some defined URL. Developer need to build some servlet, php script or something on server side that will read files from HTTP request and stores it somewhere.
    Do you know how to do it in APEX? How can I read data from HTTP POST request in PL/SQL? Now I can only call my On-Demand application process from javascript, but I am not able to read any data from HTTP POST in it.
    Can I do it in APEX, or using MOD_PLSQL?
    I would like to implement this:
    1) some javascript uploader will call some URL of my application and sends HTTP POST with data files
    2) I will read data files from HTTP POST and store them into database
    3) I will create some HTTP response for javascript uploader
    Thank you for some tips

    I know about that existing plugin " Item Plugin - Multiple File Upload"
    But I doesn't work in IE and has only basic features. Licence for commercial use is also needed. I would like to use some existing jQuery plugin. There are many of these plugins with nice features. And only one problem is that I need to create some server side process/servlet/script.. that can recieve HTTP request, get files from it and stores them into DB.

  • HTTP GET request to XI

    hi forum,
    i have been trying to send a HTTP GET request to XI using SOAP and HTTP adpaters (by designing objects in IR and ID), but failed to do so,
    the requirement is specifically sending HTTP GET, (no content in the body)
    Is there any way of achieving this using existing adapters,
    My observations:
    when i make a HTTP GET request to XI using sender HTTP adapter, it gives a response "Body is empty" with HTTP code 204-No content,
    when i use SOAP adapter, and make a HTTP GET request to intergration engine, using sender SOAP adapter, it gives a response
    <html>
    <head>MessageServlet</head>
    <body>
    Message Servlet is in Status OK
    Status information:
    Servlet com.sap.aii.af.mp.soap.web.MessageServlet (Version $Id: //tc/xi/NW04_23_REL/src/_adapters/_soap/java/com/sap/aii/af/mp/soap/web/MessageServlet.java#2 $) bound to /MessageServlet
    <br/>Classname ModuleProcessor: null
    <br/>Lookupname for localModuleProcessorLookupName: localejbs/ModuleProcessorBean
    <br/>Lookupname for remoteModuleProcessorLookupName: null
    <br/>ModuleProcessorClass not instantiated
    <br/>ModuleProcessorLocal is Instance of com.sap.aii.af.mp.processor.ModuleProcessorLocalLocalObjectImpl0_0
    <br/>ModuleProcessorRemote not instantiated
    </body></html>,
    and http response code 200 OK, but i cant find anything in the integration engine (from SXMB_MONI),
    pls help

    hi prateek..... lot of thanks,
    developing/deploying a proxy ejb for this purpose seems good,
    but, deploying a custom servlet (for calling that ejb) seems "not-so-standard" way,
    since i m very new to custom j2ee development in XI, i have certain queries:
    1. Is there any guidelines for developing and deploying custom j2ee components,
    2. Will SAP provide support in case of these components not working "as expected" or hampering other applications,
    thanks for help

  • Maintaining Sessions between http and https

    I have a web application in which I want my users to view the login page over SSL and send the login request via SSL also, but then I want to revert back to http://
    My problem is, and i've seen this problem on loads of boards with no real resolution, during the login I set some objects with in the session that are used to display information in other parts of the site... but the session object is being lost!!!
    I am using Tomcat as my web server, I saw an article on JavaWorld titled "mix protocols transparently in web applications", and apparently to over come this problem if you are using WebLogic 6.1 there is a parameter in the weblogic.xml file that must be configured, but I cant find a similar one on Tomcat!!!
    Thanks in advance

    Thanks a million for the answer, I have got it working now, but I had to do something a little different for any one else who experiances this problem I'll go through it... I set an attribute in the context which was named the the value of the current session id and contianed the session object. Then when leaving the login handeling in my dispatcher servlet I apended the session id to the url of the next jsp called. In this jsp then I retrived the "secure session" object from the context, this so far is what you suggested.
    But then I had to loop through "non secure session" object's attributes and set them in the "non secure session" object, that is I was not just able to reset the "non secure session" object equal to the "secure session" object as when I went on to the next page it was reset to the "non secure session" object again!
    The fact that the session object is changed when moving between http and https is (according to Tomcat buglist) a bug of Tomcat 4.1 and did not occur in tomcat 3.2

  • HTTPS and a Proxy server?

    Does the plugin-in still not work with HTTPS and a proxy server?
    From plug-in docs -
    "Java Plug-in supports http, ftp, gopher and SOCKS v4 protocols through the proxy server. Currently, Java Plug-in does not support https (SSL). "

    Hello
    I am making HTTPS calls from within my applet code and this works fine using the basic Java Plug-in support for HTTPS.
    This means my code basically does:
    URL url = new URL("https://myhost.com/servlet/Test");
    URLConnection conn = url.openConnection();
    etc..
    We are using Java 1.4.2. I've read in the "How HTTPS Works in Java Plug-in" for 1.3, that the plugin uses the browsers API for making HTTPS connections. Is this still the case for 1.4?
    My basic problem is that it all works fine if the browser is NOT configured to use a proxy server. If a proxy server is configured we get the following Exception in the client:
    java.io.IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 400 Bad Request ( The data is invalid. )"
    I have read that "Sun's Java Secure Socket Extension (JSSE) library allows you to access a secure Web server from behind a firewall via proxy tunnelling. However, JSSE expects the proxy's reply to the tunnelling request to begin with "HTTP 1.0"; otherwise, it throws an IOException" (http://www.javaworld.com/javatips/jw-javatip111_p.html)
    The article talks about using the JSSE library but it seems to be assuming the client is an application not an applet.
    How do I use JSSE from within an applet if all the proxy information I seem to need to set in the JSSE code is held by the browser?
    Will JSSE support proxies returning responses beginning HTTP 1.1 in the future?
    Any help on this would be greatly appreciated.
    Many thanks
    mark

  • JSF / Switch between HTTP and HTTPS

    Hello!
    I want to switch between HTTP and HTTPS using JSF.
    Under Apache Struts framework I can use struts extension "sslext.jar" to configure switching between http and https in one web application.
    e.g. Login-jsp should be secured, all other jsp's should run unsecured.
    Any ideas?
    regards
    Harald.

    Thanks,
    I made the necessary enhancement for the second phase, password confirmation required when return to SSL zone after leaving it after a succesful login.
    I did the following:
    1) create a class in the application scope and/or singleton class with the servlet paths that require SSL
    2) create a plugin that reads ActionConfigs from the ModuleConfig
    3) create a filter that sets a request scope flag that says that password must re-entered.
    Code Extracts:
    1) MainshopContainer application level parameter singleton class:
    private static HashMap sslZoneMap = new HashMap(50); // key = servlet path of request, example /login.do
    public boolean isInSSLZone(String servletPath)
    return this.sslZoneMap.containsKey(servletPath);
    public void addToSSLZone(String servletPath)
    this.sslZoneMap.put(servletPath,null);
    public int getNumberOfActionsInSSLZone()
    return this.sslZoneMap.size();
    2) Struts plugin
    add a call to loadSSLZoneMap in plugin init method:
    loadSSLZoneMap(config, mainshopContainer);
    private void loadSSLZoneMap(ModuleConfig config, MainshopContainer mainshopContainer)
    throws ServletException
    try {       
    ActionConfig[] actionConfigs = config.findActionConfigs();
    for (int i = 0; i < actionConfigs.length; i++)
    if (actionConfigs.getParameter().indexOf("/jsp/account/") < 0) // /account/* = URL path for SSL zone
    // not found = not ssl zone
    System.out.println("loadSSLZoneMap, following actionConfigs excluded from SSL Zone: "+actionConfigs[i].getPath());
    else
    // found = ssl zone
    String servletPath = actionConfigs[i].getPath()+".do";
    mainshopContainer.addToSSLZone(servletPath);
    System.out.println("loadSSLZoneMap, following servletPath added to SSL Zone: "+servletPath);
    System.out.println("loadSSLZoneMap, number of actions in SSL Zone: "+mainshopContainer.getNumberOfActionsInSSLZone());
    catch (Exception ex)
    ex.printStackTrace();
    throw new ServletException("Exception caught in loadSSLZoneMap: "+ex.toString()+" Initialization aborted.",ex);
    3)
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
    throws IOException, ServletException {
    HttpServletRequest req = (HttpServletRequest) request;
    HttpServletResponse res = (HttpServletResponse) response;
    String servletPath = req.getServletPath();
    boolean secure= this.mainshopContainer.isInSSLZone(servletPath);
    The wole picture:
    The filter adds a RequestDTO object that includes all request parameters, one of them is the secure flag.
    I have a session scope class UserContainer that includes all the session parameters, one of them is the lastRequestDTO.(last made request)
    At the end of all my jsp's I set the lastRequestDTO variable.
    In that method I set the passwordConfirmationRequired flag if needed:
    public void setLastRequestDTO(RequestDTO _lastRequestDTO)
    if (this.lastRequestDTO != null && this.lastRequestDTO.isSecure() != _lastRequestDTO.isSecure())
    this.setPasswordConfirmationRequired(true);
    this.lastRequestDTO = _lastRequestDTO;
    I read the passwordConfirmationRequired in all my jsp's in the SSL zone that allow editing or deleting and if that flag is true, a valid password must be re-entered in order to make the updates.
    When the password is OK I reset the passwordConfirmationRequired to false.
    I need some help for the first phase, that is SSL setup for all actions related to jsp's with url path /account/*
    I tought I could define it in the web.xml:
    <security-constraint>
    <web-resource-collection>
    <web-resource-name>All Account Related Pages</web-resource-name>
    <url-pattern>/account/*</url-pattern>
    </web-resource-collection>
    <user-data-constraint>
    <transport-guarantee>CONFIDENTIAL</transport-guarantee>
    </user-data-constraint>
    </security-constraint>
    but that doesn't work and finnaly understood why:
    Example: /WEB-INF/jsp/account/login.jsp corresponds to /login.do
    The url pattern /account/* at the container level is never encountered.
    Is it allowed to declare the following action path: /account/login instead of /login?
    If yes I could add following prefix /account to all my action paths and forward paths and this could resolve my problem.
    What's your opinion?
    If no, would your library resolve this?
    Will all the Struts/JSP/JSTL url generating tags pick-up the required protocol (http/https) according to your configuration file?
    Regards
    Fred

  • How can i send xml file with a http servlet request

    Hi
    Please tell me how can I send a xml file into http servlet request.
    I have a servlet(action) java file.From this servlet I have generate a xml file. Now I need to send that xml file to another servlet with http servlet request object.
    Dave.

    When you say you have generated an XML file what do you mean?
    Is it a file stored on disk? Then pass the file path as a string to the servlet.
    Is it stored in memory as an object? The pass a reference to the object to the servlet.
    Or are you asking how to communicate between servlets?
    Look in the JavaDocs for the RequestDispatcher class. You can use this class to forward the request to another servlet. Data can be passes using the RequestDispatcher by storing it as attributes using the request getAttribute and setAttribute methods. Also described in the JavaDOcs.
    http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/RequestDispatcher.html

  • Clarification for HTTP and HTTPS Sender Adapter

    Hello together,
    after some investigating concering scenarios with HTTP and HTTPS sender there are still some points that are not absolutely clear for me.
    I know that it is not necessary to configure an HTTP sender communication channel. However if I want to enforce HTTPS sender communication I think I need to add an HTTP sender communication channel with security settings enabled as well as a sender agreement.
    To my understanding these settings are activated on the Adapter Engine (Java Stack), HTTP requests however call the ABAP stack directly. How does this work exactly?
    Thank you very much for your additional explanation.

    Hi,
    see below is the format for HTTP URL
    http://<hostname:port>/<path>?<query-string>
    now query straing can only have values as given in the below link
    http://help.sap.com/saphelp_nw2004s/helpdata/en/43/64db4daf9f30b4e10000000a11466f/content.htm
    a way around can be to specify the payload for &party or &agency or &schema(if you are not using them) but then XI should be able to identify them correctly(which i m not sure how it will do),secondly the length can be a constraint coz if you add the whole payload ,the URL will become really long.
    so i would suggest you not to use it but if you really have to,then explore it properly first and then only use
    plz reward points
    thnq

  • HTTP PUT Request for File Uploads is returning a response header with content-length = 0

    After upgrading from CF9 to Coldfusion 10, I'm running into an odd issue, with `cURL` calls to a webservice that used to work.
    We are using an HTTP PUT Request with multipart="no" so that the request header content is the file itself, now the data is being sent properly in the content but it has a ~8k limit. This is fine for smaller files but some files are 60kb etc.
    Errors are odd too, near the 8KB limit we get a bad gateway error 502, and above that the webpage errors with a connection reset.
    It works fine with multipart="yes", but in a PUT request the file's data isn't even sent since it's looking for `httpparam formField` , the content-length from the target page's Headers show a content-length of 0 which causes `cURL` to fail with an error (56): http://curl.haxx.se/docs/manpage.html
    Here's example code to reproduce:
    <cfset sFilename = "C:\999\test4.txt">
    <cffile action="readBinary" file="#sFilename#" variable="fileRead">
    <cfset oFileInfo = GetFileInfo("#sFilename#")>
    <cfhttp           url="localhost/Clarence/diff_elt_test_output.cfm"
                                  method="PUT"
                                  username="******"
                                  password="******"
                                  multipart="yes"
                                  result="oHttp">
              <cfhttpparam type="header" name="Content-Type" value="text/plain" />
              <cfhttpparam type="header" name="Content-Length" value="#oFileInfo.Size#" />
              <cfhttpparam type="body" value="#fileRead#"/>
    </cfhttp>
    <cfdump var="#oHttp#">
    Dumping the response via GetHttpRequestData() shows that the header's content-length = 0 and content is blank.
    Whereas POST requests work fine, cURL has a -F form option which is our fallback but a solution to this would be great.
    Here's what I've tried:
    1. Changing CF post request limit sizes (64MB+)
    2. Changing IIS config web/webserver http runtime and security.request filtering request limits to much higher values
    3. AJP Connector between IIS and Tomcat has a default 8KB header limit, I changed that to 64k on both sides, still nothing
    Also am I missing something fundamental here? I thought at the network layer a packet is split up and rejoined, so large content in a http request body should work, what's wrong with Coldfusion 10?

    I am familiar with java.net package and know how to
    Read and Write Streams.
    However, what I do not know is what string
    represntation of PUT or POST resquests is?It's HttpURLConnection.setRequestMethod("PUT") or ("POST").
    Also you have to setDoOutput(true).
    Then you set the content type, possibly encode the input, set the content length, and write the file data to the stream.
    Using a Jakarta package may be easier, however.

  • HTTP POST Request with XML file in

    Hi @ all,
    I would like to send an HTTP Request with an XML File in the body to an SAP System
    I have the target URL and the a XML File.
    Now the question is. Is it possible to use something like the HTTP_POST FuBa to send an url post request with an xml file?
    If yes can anybody give me a hint?
    I have a php script which exactly do this coding. But to integrate it all in one system it is necessary to transform it into ABAP and call it there.
    // compose url and request and call send function
    function test($productID, $categoryID) {
         // create url
         $PIhost = "XXX.wdf.sap.corp";
         $PIport = "50080";
         $PIurl = "/sap/xi/adapter_plain";
         $PIurl .= "?sap-client=800";
         $PIurl .= "&service=XXX";
         $PIurl .= "&namespace=XXX";
         $PIurl .= "&interface=Frontend_Interface";
         $PIurl .= "&qos=EO";
         $PIurl .= "&sap-user=XXX";
         $PIurl .= "&sap-password=XXX";
         // create xml
         $request = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
         $request .="<n1:FrontendInbound_MessageType xmlns:n1=\"http://crmpiebay.com\">\n";
         $request .= "\t<FrontendInbound>\n";
         $request .= "\t\t<ProductName/>\n";
         $request .= "\t\t<ProductCategory>".$categoryID."</ProductCategory>\n";
         $request .= "\t\t<ProductID>".$productID."</ProductID>\n";
         $request .= "\t\t<MessageID/>\n";
         $request .= "\t</FrontendInbound>\n";
         $request .= "</n1:FrontendInbound_MessageType>";
         // send http request
         postToHost($PIhost, $PIport, $PIurl, $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"]."/".$_SERVER["PHP_SELF"], $request);
    // send post request to PI server
    function postToHost($host, $port, $path, $referer, $data_to_send) {
      $fp = fsockopen($host, $port);
      if($fp) {
           $res="";
           fputs($fp, "POST $path HTTP/1.1\r\n");
           fputs($fp, "Host: $host\r\n");
           fputs($fp, "Referer: $referer\r\n");
           fputs($fp, "Content-type: text/plain\r\n");
           fputs($fp, "Content-length: ". strlen($data_to_send) ."\r\n");
           fputs($fp, "Connection: close\r\n\r\n");
           fputs($fp, $data_to_send);
           while(!feof($fp)) {
               $res .= fgets($fp, 128);
           fclose($fp);
           return $res;
    Would be great if anybody could give me a hint how to solve such a HTTP Post request with XML body data.
    Thanks in advance.
    Chris
    Edited by: Christian Kuehne on Feb 26, 2009 4:32 PM

    hi friend could you please share your solution regarding this query if u got it already?

  • ACE http probe "request method type" mandatory on A3(2.6)?

    Hi people,
    I recently upgraded to A3(2.6) from A3(2.0) and I don't see the N/A option on the http probe "request method type".
    It also has an asterisk * which means it's mandatory.
    I tried to set up a new http probe for another farm I am creating and the probe shows status failed, although I can ping and telnet to the http server on port 80 from the ACE context. My probe is like that:
    probe http http_probe_WWW
      interval 15
      passdetect interval 60
      expect status 200 200
      open 10
    My other http probes for other farms work ok after the upgrade and they are similar.
    So my question is: Do I need to set the request method type or something else causes the probe to fail?
    thanks a lot.
    George

    What you see is a problem with the GUI.
    CSCtg78008    while creating http probe default method slected should be get as in CLI
    But the request-method is not required.
    So your config should work.
    Do a 'show probe detail' to see the failure reason.
    Get a sniffer trace as well.
    Regards,
    Gilles.

  • Access denied: HTTP - Host Request with Widget Foundation + Yahoo

    Hi,
    I have a problem with the new Yahoo widget engine's (4.5) suggested structure, when trying to execute an RFC request.
    An older version of my .kon file has a classic structure, and it works fine, I write the script into the .kon file, it looks like this:
            <action trigger = "onLoad">
            <![CDATA[
                     // Standard SAP Widget Foundation Libraries
                     include("js/utils/Common.js");
                     include("js/utils/PlatformUtil.js");
                     include("js/utils/Timer.js");
                     include("js/utils/DataLoader.js");
                     include("js/utils/RFCRequest.js");
                     request.execute(function(response) ...
            ]]>
            </action>
    When I try to use the new structure (the .kon file contains only the source of the script, no CDATA, just  'src = "Scripts/Main.js"' ), and execute the request from the source JavaScript file, then I get this error:
    utils.DataLoader]> Exception was catched: XMLHttpRequest.send(): Access denied: HTTP - Host Request.
    Saw anybody this problem already?
    Thanks,
    Gyuri

    Hi,
    Yahoo has added security control in widgets since 4.5. You should add tag <security> in your widget.xml
         <security>
              <http>all</http>
              <filesystem>full</filesystem>
              <command>true</command>
              <hotkey>true</hotkey>
         </security>
    http://widgets.yahoo.com/static/downloads/WidgetsReference_4.5.zip page 33.
    Eriks

Maybe you are looking for