Unclear on URL rewriting for SunONE

On IAS 6.5 running on IWS 6.0 SP4, when is a URL actually rewritten with the Session ID?
1. When I call response.encodeURL(theURL) so that its return value should be theURL with the extra Session ID params.
2. When the html is sent back and the AppServer or WebServer intercepts the html and rewrites all URLs regardless of whether I called response.encodeURL(someURL).
I ask cause it doesn't seem like response.encodeURL is doing anything. Although other URLs that I didn't explicitly encode are getting encoded.
I have found that the URLs that are not rewritten with the Session ID are those that appear in:
1.Javascript such as onClick="javascript:document.location.href='/NASApp/myscriptservlet' "
2. Posted Forms such as <form method="post" action="/NASApp/myapp/myformservlet">
And URLs that are rewritten with the Session ID are those that appear in:
1. Anchor Tags such as link
2. Image Tags such as <img src="/NASApp/myapp/myimageservlet">
The worst part of it all is that in my JSP I explicitly call encodeURL for the URL in the javascript and the form action URL and these are the two that don't get encoded.

Hi Stefan,
You are right! It doesn't support to set URL / HTTP parameters outside the logical port.
Nevertheless, I have debugged the whole engine and found out that via custom coding (enhancements / modifications) and with extreme attention, the URL can be rewritten as desired.
When a method of the proxy is called, let's say for instance: lo_proxy->logout (...) - as written up for example, the method CL_HTTP_CLIENT=>CREATE_BY_URL is called dynamically.
In this method, in the "url" variable is the desired URL that needed to be rewritten.
Here it's about an importing parameter, so it cannot be changed so easily, but it's not impossible.
Another place where a nice Enhancement can be created is at the beginning of the FM "SWLWP_URI_PARSE".
You need to be very careful not to change these places in all cases (this CREATE_BY_URL will be called pretty much), JUST when the specific conditions are fulfilled.
Have a great day / week!
Warm regards,
Alex

Similar Messages

  • URL rewriting for a WebService Consumer Proxy

    Hi all,
    Did anybody come across this issue?
    I have a SAP System - let's call it "TM" -  that I want to bind with another non-SAP one - let's call it "FB" - without any PI between them.
    The communication is made as a Service Consumer (TM side), the Proxy (see image below) and Proxy-Implementation Class being generated automatically after the ".wsdl" file and the "url" given by the documentation of FB.
    Everything looks good! All the Methods (operations) that are available from the service have been added to the Implementing Class.
    After the Proxy generation, I also created the Logical Port (in transaction SOAMANAGER - see image below) where the path, host, prefix, and all the necessary stuff were also automatically created after the ".wsdl" document.
    So far so good! When I want to test it and to play along with this connection TM -> FB, I am creating the Proxy-Object, I am filling the required User / Pass / and an ID in order to call the first method. As you have probably guessed already: LOGIN.
        ls_in_login-login_request-id             = '...some ID...'.
        ls_in_login-login_request-user          = '...some user ...'.
        ls_in_login-login_request-password  = '...some password'.
    TRY.
             CREATE OBJECT lo_proxy
               EXPORTING
                 logical_port_name = 'ZAS_PORT_FB'.
         CATCH cx_ai_system_fault INTO lo_ref.    " Application Integration: Technischer Fehler
    ENDTRY.
       TRY.
           CALL METHOD lo_proxy->login
             EXPORTING
               input  = ls_in_login
             IMPORTING
               output = ls_out_login.
         CATCH cx_ai_system_fault INTO lo_ref.    " Application Integration: Technischer Fehler
         CATCH cx_ai_application_fault INTO lo_ref.    " Application Integration: Applikations Fehle
    ENDTRY.
    As a response, (meaning that the connection works and that the WebService acknowledges the connection) I get a "SessionID" -> a string of characters.
    In the Wiki of the Service is written that from this point on, every other methods (but I mean ALL of them, logout() also...) need to be called along with this SessionID. The problem is, that this SessionID doesn't have a specific place in the "inbound"-structure of the methods, but this mechanism of passing around the SessionID must be made with URL rewriting. Another solution would be to use COOKIES. From my point of view, a so-called URL rewriting would be easier, right?
    In the documentation is the following info written:
    URL rewriting (recommended):
    The JSessionId is attached to the URL of the SOAP request, as follows:  http://[URL];jsessionid=[jsessionid]
    Caused by tecnical reasons, it is necessary to specify the static string “;jsessionid=” in lower case letters.
    I have turned this "LO_PROXY" object around and around and around... trying to find a solution... a method...anything that would let me rewrite the URL, but nothing...
    I have also tried to use ce CL_HTTP_CLIENT class and to create myself the client and the URL and the host and everything manually... but in this case how do I end up in calling a specific "custom" method -> for instance... how do I call the "LOGIN"... or the LOGOUT...where do I put the parameters, etc?
    Do you have any suggestions / ideas / hints ?
    Thanks a lot in advance!
    Warm regards,
    Alex

    Hi Stefan,
    You are right! It doesn't support to set URL / HTTP parameters outside the logical port.
    Nevertheless, I have debugged the whole engine and found out that via custom coding (enhancements / modifications) and with extreme attention, the URL can be rewritten as desired.
    When a method of the proxy is called, let's say for instance: lo_proxy->logout (...) - as written up for example, the method CL_HTTP_CLIENT=>CREATE_BY_URL is called dynamically.
    In this method, in the "url" variable is the desired URL that needed to be rewritten.
    Here it's about an importing parameter, so it cannot be changed so easily, but it's not impossible.
    Another place where a nice Enhancement can be created is at the beginning of the FM "SWLWP_URI_PARSE".
    You need to be very careful not to change these places in all cases (this CREATE_BY_URL will be called pretty much), JUST when the specific conditions are fulfilled.
    Have a great day / week!
    Warm regards,
    Alex

  • Always use URL Rewriting for session tracking?

    All you JSP guru:
    I am working on a JSP project that requires session tracking. I have successfully implements session tracking with both cookies or URL rewriting. I know that with the HttpSession object, it will always try to use cookie first, if that's disabled, then it'll automatically switch to URL rewriting. However, is there a way to force the HttpSession object to ALWAYS use URL rewriting instead of cookies? I have searched for an answer for a long time and haven't been able to found a solution. Is it possible at all? Thank you very much.

    i was going to say that WebSphere always uses URL rewriting if you enable it at all, but someone beat me to it (indirectly) :-)
    however, that seemed to me to be a violation of the spec, which seemed to imply the behaviour you're describing (only use URL rewriting if cookies are not supported on the current client)
    here's a response someone else made on a websphere newsgroup to a statement in that regard:
    I believe you are technically correct. However from my
    experience, I think the spec if flawed in this area since
    there is no reliable way of determining whether the
    client browser supports cookies. The authority on
    cookies (www.cookiecentral.com) says:
    "To properly detect if a cookie is being accepted via
    the server, the cookie needs to be set on one HTTP
    request and read back in another. This cannot be
    accomplished within 1 request."
    This is asking too much of a servlet engine
    implementation. Even if it did submit a request for this
    purpose, the user could refuse the cookie. So
    then technically the browser supports cookies, but the
    servlet engine infers it doesn't. So if the servlet engine
    infers the browser does not support cookies and so
    encodes the URL, it is again out of spec because the
    browser really does support cookies. By doing it
    however encoding is configured makes things simpler,
    robust, consistent and avoids the flaw.
    My opinion.so, mostly i'm just rambling, but if you're using websphere, you should get the behaviour your boss wants. if you're using something else, i suppose there's a chance it'll "violate" the spec in this same, potentially helpful way.
    btw, i remember somebody else complaining that URL rewriting is less secure than cookies, but i kinda think they're about equal. it seems like either could be intercepted by a sniffer and then used to spoof. but i'm no expert in that stuff...

  • APEX: Internet domain mapping / URL rewrite for Apps in the cloud

    Hello,
    I have registered for a trial access since first day in which the cloud was launched ... But, did not get access till now ... If I were to buy it, am I going to get access right away ??
    Is Oracle Cloud going to offer Internet domain name mapping to a specific APEX application ???
    Is Oracle Cloud u going to offer URL rewrite where APEX URL is not Search Engine friendly.... e.g:
    This site: http://www.enkitec.com/ was built on APEX, but as you can see the URL was rewritten ????
    Best Regards,
    Fateh

    Hi,
    According to your post, my understanding is that the rule was not processing for SharePoint 2013 result page.
    Please make sure you add the reverse rewriting rule correctly.
    For more information, you can refer to:
    Add the reverse rewriting rules (in the HTML)
    Setting up a Reverse Proxy using IIS, URL Rewrite and ARR
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Apache Url rewrite for portal URLs

    Hi,
    I have a requirement where i need to write simple URL's for the default portal uRL's
    for example
    inspite of using default url like "http://myserver:port/portal/server.pt/community/abc_xyz/123/efg_jkl/12345",
    if user uses
    "http://myserver:port/portal/server.pt/xyz"
    It should navigate to same default URL.
    Can somebody let me know how this can be achieved.
    I know Url rewriting is done through Apache Url rewrites but do not have an idea how apache does it with portal Url's. What configurations need to be done in order to manage portal Url's with apache rewrites.
    Thanks
    Ajay

    Hi Ryan,
    Thanks for the reply. The link shows how to write the Rewrite rules in apache. I am familier with that. The actual problem is that how can the portal Url's be controlled by apache rewrites. My apache and weblogic are both on the same server instance but after writing the rewrite in httpd.conf file. It does not work out. Just want to know how can i tell apache to handle my portal Url's too.
    Is there any specific entry that we need to make for doing this.
    Thanks
    Ajay

  • Using URL Rewrite for HNSC Web App

    Greetz!
    I'm using host named site collections in my deployment of 2013 Enterprise. I've got a single web app, on the default zone, that was created on port 443 with the -SecureSocketLayer parameter. How can I seamlessly redirect users accessing a HNSC with http
    to the correct (and only) https url? I'm using the URL Rewrite 2.0 with IIS 8.5.
    I have the following rule in place but it is still throwing a 404 on pages. Is this able to work with Host Named Site Collections and does it matter that I've installed the Web App on 443 without having it on 80 first? It shouldn't but SharePoint has
    surprised me before ;):
      <rule name="SSL Redirect" enabled="true" stopProcessing="true">
                    <match url="(.*)" />
                    <conditions>
                        <add input="{HTTPS}" pattern="off" />
                    </conditions>
                    <action type="Redirect" url="https://{SERVER_NAME}" redirectType="Found" />
                </rule>
            <rule name="HTTP/S to HTTPS Redirect" enabled="false" stopProcessing="true">
              <match url="(.*)" negate="true" />
                <conditions logicalGrouping="MatchAny">
                        <add input="{SERVER_PORT_SECURE}" pattern="1" />
                        <add input="{SERVER_PORT_SECURE}" pattern="0" />
         </conditions>
         <action type="Redirect" url="https://{HTTP_HOST}" redirectType="Permanent" />
         </rule>
    Love them all...regardless. - Buddha

    are you using the URL Rewrite on the same IIS web application as the SharePoint sites?
    Scott Brickey
    MCTS, MCPD, MCITP
    www.sbrickey.com
    Strategic Data Systems - for all your SharePoint needs

  • URL rewriting for the links

    Hi
    I have my webapplication which is running on tomcat ....and as of now i havent encoded any of my links in the web application ...they are like
    <a href="/action.do?id=1"></a>
    Is it my duty to keep all the URLs encoded so that if the client diables the browser this would be helpful ??
    Currently then if a client disables the cookies my application should not work properly right ??
    Can any one enlighten this

    If you are using Struts, then use the html:link tag.
    That will automatically encode the URLs for you if necessary.
    <% pageContext.setAttribute("id", "1"); %>
    <html:link action="/action" paramId="id" name="id"/>
    http://struts.apache.org/userGuide/struts-html.html#linkCheers,
    evnafets

  • Supress URL rewriting through gateway for specific URL's ??

    I want to know how to supress URL rewriting for some spcific URL's. Currently the property "Rewrite All URL's" is set to true in the gateway profile.
    Default ruleset is applied on to the rewriter during installation. Do I need to write a ruleset to achieve this ?? If yes, how to approach onto developing this ruleset.
    Please help.
    Thanks.

    I don't think what you ask is possible, but the reverse is.
    Do not select Rewrite All URL's. In my knowledge it really is all and no exceptions possible. BTW The ruleset define what's inside HMTL etc., not which links are to be rewritten.
    Solution:
    In Admin console:
    Service Management -> Gateway-> <your gateway profile> ->Proxies for Domains and Subdomains
    Fill this with the domains you want rewritten. All other domains are not rewritten.
    Lemme know if this helps.
    This site (and the Sun One Portal) needs feedback!
    Ronald

  • URL Rewriting in JSP/Servlets

    Enabling URL rewriting for session support where cookies are switched off, results in the URL being rewritten as myURL/$SessionID$a_very_long_string.
    I believe that the /$SessionID$ is configurable on the server, does anyone know how ?
    OAS version 4.0.8.1. patched with JSP support.

    Why is it placing a ';' before jsessionid ? Shouldn't
    it be a '&'? The current result is a page not found.Your url looks ok to me. '&' seperates parameters. I'm using the Struts framework to handle those ugly details and it generates urls like this one for me:
    http://localhost:8080/JspMini/main.jsp;jsessionid=C2C1C2D9C6106758047127038554C813
    Looks like you have another problem...
    HTH, Markus

  • WCF Url Rewriting using global.asax

    Hello,
    I am doing Url Rewriting using global.asax but getting below error message. 
    Description: HTTP
    404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly. 
    Requested URL: /Services/MyService.svc/rest/CheckInternet
    I tested service. its working fine without url rewriting. 
    please help me to solve this issue. 
    Please "Mark as Answer" if this post answered your question. :)
    Kalpesh Chhatrala | Software Developer | Rajkot | India
    Kalpesh 's Blog
    VFP Form to C#, Vb.Net Conversion Utility

    Hi Kalpesh Chhatrala,
    I wonder if you are using the WCF Soap Service or the WCF Rest Service.
    Since your WCF Service works very well without the URI Rewriting, then it seems that you have do something wrong during the process of the URI Rewriting, so please try to refer to the following articles about how to do the URI Rewriting
    for the WCF Service:
    http://blogashwani.blogspot.com/2013/02/url-rewriting-for-wcf-service.html .
    http://blogs.msmvps.com/abu/2008/12/22/url-rewriting/ .
    http://blogs.msdn.com/b/endpoint/archive/2008/08/22/rest-in-wcf-part-ix-controlling-the-uri.aspx .
    Best Regards,
    Amy Peng
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • If user disable cookie how to set and use session with URL Rewritting

    if user disable cookie how to set and use session with URL Rewritting by append session ID in url

    If cookies are disabled, then app server will automatically try to use URL rewriting for session control. Programmer's responsibility is to encode any links or redirects using
    response.encodeURL("/yourPage.jsp")
    and
    response.encodeRedirectURL("/yourPage.jsp")
    See API for details
    http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/http/HttpServletResponse.html#encodeURL(java.lang.String))

  • Server 2012 R2 essentials url rewrite to exchange 2013 breaks remote web workplace

    Hi all
    Have a server 2012 r2 with essentials experience installed and an exchange 2013 sp1 on a member server.
    I have 2 certificates
    remote.domain.com for the essentials rww
    mail.domain.com for exchange owa
    I have added the administrator account to enterprise admins and have joined the exchange server with the essentials connector, so it appears on the dashboard.
    Both certificates are installed correctly.
    I have installed ARR 3.0 and created a serverfarm mail.domain.com and accepted that it created url rewrite for me.
    Server farm does not have ssl offload enabled.
    The url rewrite is setup like this:
    Requested url: matches pattern, Using: Wildcards, Pattern *
    Conditions: Match All, Input: HTTPS, Type: Matches the pattern, Pattern: ON
    Action: Route to server farm
    Scheme: https://, Server farm: mail.domain.com, Path: /{R:0}
    Stop processing of subsequent rules: checked
    Now pointing protokol 443 til the IP of the essentials server and navigating to https://mail.domain.com/owa brings the owa logon page with my trusted server certificate and all.
    Everything works fine.
    If I then navigate to https://remote.domain.com/remote then the webpage should show the login to the essentials remote web workplace. 
    But instead it shows a some what crippled version, like forms and pictures missing and it is obviously not working.
    Trying to troubleshoot i changed the url rewrite from wildcards to exact match and put owa into the pattern field.
    Then my remote web workplace showed up correctly with the matching certificate and all was fine.
    But now owa shows a 404 directory not found.
    I guess I need some help on this.
    Somehow that server farm and the url rewrite, messes up my default website, with the remote site.
    Much appreciated...
    \Lars

    Lars,
    RE-Run the WSE wizard to reset the Internet settings.
    Remove ARR and URLReWrite.
    Once removed reboot.
    Install ARR and URLReWrite again by downloading.
    Do NOT configure any farm settings.
    Use the ARRConfig utility that comes with WSE:
    http://technet.microsoft.com/en-us/library/jj200172.aspx
    That TN page explains how to run the utility. Make sure you have exported the mail certificate including Public Key and Extended Properties first.
    Philip Elder Microsoft Cluster MVP Blog: http://blog.mpecsinc.ca

  • Regex help for URL rewriting

    I have the following regular expression for rewriting a URL (from existing code which I had to make some quick changes)
    String     regex = "s#(href|src|url|action|background)=(\"?)(/|" + "http:originalserver.com" +"/|http.?://" + "originalserver.com"+ ")([^\">]*?)(\"?)#$1=$2" + "myserver.com" + "/$4$5#gis";
    which does a URL rewrite and changes the URL from something like
    src="http://originalserver.com/images/someimage.gif" to
    src="http://myserver.com/proxy/images/someimage.gif"
    Now I want to change this regex to add some parameters to the URL. ie.
    case 1:
    href="http://www.originalserver.com/index.htm"
    to
    href="http://www.originalserver.com/index.htm?myParam1=myValue1
    case 2:
    href="http://www.originalserver.com/index.htm?originalP1=originalV1"
    to
    href="http://www.originalserver.com/index.htm?originalP1=originalV1&myParam1=myValue1"
    How can I change the regex to do this. As I have to do this fast and not an expert in Regex, any help would be appreciated.

    Hi,
    try this :
    - first set delimiter (? or &) to append your parameters :
    char delimiter = '\?';
    String myParams = "myParam1=myValue1";
    Pattern p = Pattern.compile( "\?" );
    Matcher m = p.matcher( url );
    if( m.matches() )
    delimiter = '\&'; // not sure ampersand needs to be "backslashed"
    - then use the modified regex
    String regex = "s#(href|src|url|action|background)=(\"?)(/|" + "http:originalserver.com" +"/|http.?://" + "originalserver.com"+ ")([^\">]*?)(\"?)#$1=$2" + "myserver.com" + "/$4$5" + delimiter + myParams + "#gis";

  • URL rewrite now working for SharePoint 2013 result page

    Hi,
    I have configured reverse proxy using URL Rewrite (ARR), all works fine but the rule is not processing for SharePoint 2013 result page. It still shows internal domain name and not external domain name.
    this is my web.config in internet web server
    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
        <system.webServer>
            <rewrite>
                <outboundRules>
                    <rule name="ReverseProxyOutboundRule1" preCondition="ResponseIsHtml1">
                        <match filterByTags="A, Area, Base, Form, Frame, Head, IFrame, Img, Input, Link, Script" pattern="^http(s)?://dsplsp2013/(.*)" />
                        <action type="Rewrite" value="http{R:1}://uncep/{R:2}" />
                    </rule>
                    <preConditions>
                        <preCondition name="ResponseIsHtml1">
                            <add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
                        </preCondition>
                    </preConditions>
                </outboundRules>
                <rules>
                    <rule name="ReverseProxyInboundRule1" stopProcessing="true">
                        <match url="(.*)" />
                        <action type="Rewrite" url="http://dsplsp2013/{R:1}" />
                        <serverVariables>
                            <set name="HTTP_ACCEPT_ENCODING" value="" />
                        </serverVariables>
                    </rule>
                </rules>
            </rewrite>
            <urlCompression doStaticCompression="false" />
        </system.webServer>
    </configuration>
    Thanks
    Hari
    Hari

    Hi,
    According to your post, my understanding is that the rule was not processing for SharePoint 2013 result page.
    Please make sure you add the reverse rewriting rule correctly.
    For more information, you can refer to:
    Add the reverse rewriting rules (in the HTML)
    Setting up a Reverse Proxy using IIS, URL Rewrite and ARR
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • URL rewrite in iplanet sun web server 6.0

    HI,
    I've been using SunONE web server 6.0 for a while.
    Our website is changing to adapt URL rewrite. Can you please show me how or where to get such information about how to do URL rewrite in web server 6.0?
    http://domain.com/index.php?=c2345 ----> to this nice-looking URL http://domain.com/index/mainsite
    thanks so much!

    This would be non-trivial in WS6.0. Additionally, WS6.0 is end-of-lifed, and has known security problems that are NOT going to be fixed. You should consider upgrading.
    URL re-writing (and much more) is a native feature of WS7.0.

Maybe you are looking for

  • ALchemy request for Creative

    Do you think it would be possible to add application detection for Steam games and for x64 installs? I have configure all my games manually because the ALchemy application's built-in list is only aware of CD installs, and is not aware of the wow64nod

  • Regarding conversion of image to video

    Hi All, I need a small help. My requirement is to convert a text file in to an image file by attaching a background and that image is converted into video file by attaching audio file. please guide me how i can achieve this using sun java API. Is thi

  • Error in FP50 - Manual Outgoing Checks Lot

    Hi Experts, I am getting error while I am creating outgoing check using FP50 - Account determination not possible for key 7777  /      /CS    /0600 /0020. I have maintained the main sub 0600 0020 in SPRO at below path - Financial Accounting (New) -->

  • Install officejet 4500 g510g-m

    im trying to install the office jet 4500 all in one to my computer please help to install This question was solved. View Solution.

  • Help me with this. my dashboard gone crazy

    Help, everytime I press the volume button of my macbook, my dashboard appears instead of increasing the volume. but when I press the original keys for the dashboard, it wont appear. I created a mess! I feel like my macbook is so dirty. How can I brin