Safri browser 3.1.2 SOAP Request HTTP 400 Error

Hi,
I have a simple html making ajax calls (XMLHttpRequest) to our webservice on a button click. The code works fine with major browsers like FireFox, IE and Opera. But if i load the html in Safari and send the SOAP request to the webservice using XMLHttpRequest, i get an HTTP 400 - Bad Request Error from the server.
Why is it failing just for the safari browser? Do i need to set any extra HTTP headers? When i see the WireShark captured packets for Firefox and Safari, i see the content length is different. And also Safari is missing a lot of headers.
Could you please help troubleshoot the issue?
PS: The webserver is running IIS 6.0 on windows server 2003.
regards
srividhya

I'm not sure how to help you. No link found.
Try this to see how Safari performs XMLHttpRequests:
http://www.mnot.net/javascript/xmlhttprequest/
Every browser is different...

Similar Messages

  • Invalid request in SOAP Scenario - "HTTP 400 Bad Request"

    Hi,
    By sending request to a Webservice thorugh XI ,I am getting an error as "HTTP 400 Bad Request" in MONI and the response payload looks like this
    "Request Error (invalid_request)
    Your request could not be processed. Request could not be handled 
    This could be caused by a misconfiguration, or possibly a malformed request. 
    For assistance, contact your network support team."
    I copy pasted the request payload in SOAP UI,  there its working fine.I don't know where it goes wrong.
    Please help me in that...
    Thanks & Regards,
    Yuga

    Hi Yugapreetha,
    Error: HTTP 400- Bad Request- ICM_HTTP_CONNECTION_FAILED
    Description: The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repeat the request without modifications.
    Possible Tips: May be because of huge message flow. Related SAP Notes-824554, 906435, 783515, 910649, 706563 If it is because of Queue problems have a look into SMQ2 .
    And also here are a list of possible reasons for your problem with solutions.
    It could be that it cannot find your file adapter.
    1. Have you specified your hostname or IP address? Often the server cannot resolve the ip address for the hostname of your PC.
    2. Is the path and port in the directory the same as the path and port of your file adapter?
    3. Try question 14 (integration engine section)
    /people/mark.finnern/blog/2006/01/12/finally-best-of-sdn-2005
    4. also question 11 (in the same section)
    5. if the avove will not fix it open XI config guide and
    have a look at section
    "Connecting Business Systems with an Integration Engine to the Central Integration Server"
    6. Your error code is 400, so check this link,
    http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
    For http 400 - its a bad request.
    'The request could not be understood by the server due to malformed syntax.'
    If you have the XI trouble shooting guide see from page 54,and also try:
    1.Check that the port really is the ICM HTTP Port (transaction
    SMICM) and not the J2EE port
    2.If the port is wrong, change the pipeline URL in the SLD in
    the business system of the Integration Server
    3.Restart the J2EE Engine to reset the SLD buffer of the
    Adapter Engine
    Source- "XI troubleshooting guide"
    Check out this SAP Note- 824554
    Also this links
    ICM_HTTP_CONNECTION_FAILED
    Cache Refresh~
    https://websmp201.sap-ag.de/~sapdownload/011000358700003163902004E/HowTo_handle_XI_30_Caches.pdf
    Reprocessing failed XI messages:
    /people/sap.user72/blog/2005/11/29/xi-how-to-re-process-failed-xi-messages-automatically
    Regards,
    Vinod.

  • Http 400 error when accessing website on a browser

    My website which was formally working fine is now not!
    When I tried to look at my website on a browser yesterday all I got was error message http 400.
    So I figured I may have an error in my design somewhere due to recent changes so I then tried to upload a earlier version of my website (that I know contains no errors and functions correctly) and I get a 'timed out' error when trying to put it to the remote server
    Started: 20/09/2011 10:27 AM
    Analyt\analyt.html - Put operation successful
    Analyt\analyt_compost.html - Put operation successful
    Analyt\analyt_leaf.html - Put operation successful
    Analyt\analyt_leaf_clip_image002.gif - Put operation successful
    Analyt\analyt_leaf_clip_image004.gif - Put operation successful
    Analyt\analyt_leaf_clip_image006.jpg - Put operation successful
    Analyt\analyt_pathology.html - Put operation successful
    Analyt\analyt_soil.html - Put operation successful
    Analyt\analyt_water.html - Put operation successful
    Assets\AAS.jpg - Put operation successful
    Assets\analyt_compost_clip_image002.gif - Put operation successful
    Assets\Anna.JPG - Put operation successful
    Assets\Ash.jpg - Put operation successful
    Assets\BioLogo.jpg - Put operation successful
    Assets\Bio_980x150_Banner.swf - Put operation successful
    Assets\Bluetongue.jpg - Put operation successful
    Assets\BoreMonotor.jpg - Put operation successful
    Assets\Compost_Pile.jpg - Put operation successful
    Assets\Contamination.jpg - Put operation successful
    Assets\Contamination_Small.jpg - Put operation successful
    Assets\Culture.jpg - Put operation successful
    Assets\DeepRiver.jpg - Put operation successful
    Assets\Dieback.jpg - Put operation successful
    Assets\Drew.jpg - Put operation successful
    Assets\Driller1.jpg - Put operation successful
    Assets\Driller2.jpg - Put operation successful
    Assets\Driller3.jpg - Put operation successful
    Assets\Drilling3.jpg - Put operation successful
    Assets\Fig8-AAMGL.jpg - Put operation successful
    Assets\Fig8-AAMGL_samll.jpg - Put operation successful
    Assets\FloraRightSide.jpg - Put operation successful
    Assets\FloraRightSideA.jpg - Put operation successful
    Assets\FloraRightSideB.jpg - Put operation successful
    Assets\Genette.jpg - Put operation successful
    Assets\Glassware.jpg - Put operation successful
    Assets\GroundMod.jpg - Put operation successful
    Assets\Handdrill.jpg - Put operation successful
    Assets\hand_soil.jpg - Put operation successful
    Assets\HPLC.jpg - Put operation successful
    Assets\index.jpg - Put operation successful
    Assets\Kylie.jpg - Put operation successful
    Assets\Louise.jpg - Put operation successful
    Assets\Olivia.jpg - Put operation successful
    Assets\Peter_0000.jpg - Put operation successful
    Assets\PumpingTest.jpg - Put operation successful
    Assets\Sidebar_Background1.jpg - Put operation successful
    Assets\Sidebar_Background_Waste.jpg - Put operation successful
    Assets\Sidebar_Background_Water.jpg - Put operation successful
    Assets\Side_Background7.jpg - Put operation successful
    Assets\Small_Plant.jpg - Put operation successful
    Assets\Soilsamples.jpg - Put operation successful
    Assets\soil_profile.jpg - Put operation successful
    Assets\soil_reactivity.jpg - Put operation successful
    Assets\Sorter.jpg - Put operation successful
    Assets\thinking.jpg - Put operation successful
    Assets\UWMP.jpg - Put operation successful
    Assets\UWMS.jpg - Put operation successful
    Assets\Veg_Panorama2Small.jpg - Put operation successful
    Assets\Vindya.jpg - Put operation successful
    Assets\WaterDrop.jpg - Put operation successful
    Assets\WaterTestingEquip.jpg - Put operation successful
    Assets\Wetland.jpg - Put operation successful
    Assets\wetland2.jpg - Put operation successful
    Assets\Zebrafish.jpg - Put operation successful
    Operation timed out. Cancelling...
    Operation timed out. Cancelling...
    Operation timed out. Cancelling...
    Operation timed out. Cancelling...
    Operation timed out. Cancelling...
    The part where it is cancelling is my CSS folder I think.
    Anyone help?

    This is what I am seeing:
    Bad Request (Invalid Hostname)
    The other websites on the same IP are running OK:
    toowoombahonda.com
    www.accounting4u.com.au
    www.advancedmatting.com.au
    www.buyacres.com.au
    www.cgcinteriors.com.au
    www.equiaustralia.com.au
    www.firstbite.com.au
    www.gallbrosmedical.com.au
    www.groomersproducts.com.au
    www.robewaterfront.com.au
    Have you tried loading just a single page to test your server if it is misconfigured?  Alternatively, you may have to contact your host to see if there is anything wrong at their end.
    DW files do not create this problem.  even if you have some problems with your code they do not make your server go down.  DW files are simple text files and cause no problems.

  • WinRM - WsManFault - HTTP Bad Request status (400) - Error number: -2144108175 0x80338171

    I am trying to configure the WinRM in my servers for eventlog forwarding but I am facing issue when i run "winrm qc" command on domain controllers. I get the following error,
    WinRM already is set up to receive requests on this machine.
    WSManFault
        Message = The WinRM client received an HTTP bad request status (400), but the remote service did not include any other information about the cause of the failure.
    Error number:  -2144108175 0x80338171
    The WinRM client received an HTTP bad request status (400), but the remote service did not include any other information about the cause of the failure.
    Please help me resolve this. I searched many articles but no result. Nothing helped.
    Regards,
    Sameer Gawde

    Hi Sameer,
    Before going further, would you please let me confirm edition information of the server OS that this issue
    occurred? Was it Windows Server 2008 or Windows Server 2008 R2 or any other?
    Based on the error message, this issue may occur if the Window Remote Management service and its listener functionality
    are broken. Please refer to resolution in following KB and check if can help you.
    Errors when you run winrm commands to check local functionality
    in a Windows Server 2008 environment
    If any update, please feel free to let me know.
    Hope this helps.
    Best regards,
    Justin Gu

  • Apex Getting HTTP-400 error

    Hi,
    I created a form with many things to be updated and got this error. Can anyone help? Thanks.
    Bad Request
    Your browser sent a request that this server could not understand.
    mod_plsql: /pls/toolsdb/wwv_flow.accept HTTP-400 Too many arguments passed in. Got 2176 parameters. Upper limit is 2000

    Hello
    Can’t figure out what it causes but the solution is to schedule a little job with this statement:
    ALTER SYSTEM FLUSH SHARED_POOL
    Mortus...

  • Set Rendered on a 'Add' button to False has caused HTTP 400 error

    Hi,
    I am trying to personalise in Manager SS a custom version of seeded 'Documents of Record' function HR_DOR_SS to make the Add Record button non-display on the Documents of Record table. I changed Rendered to False, got the 'Setting this item to false may hide this item and its children' message but went ahead and did it anyway.
    Outcome is that I can see the records in the table but can no longer view, update or delete existing records. I get a http 400 bad request page. I changed the 'Add' button back to Rendered True, but problem persists. Get the error also when I try to create a new record using the now re-instated button. Imported the personalization from another environment where it's working fine, bounced apache, clear cache etc and still problem persists.
    Also if no record exists for employee, Add button works fine and I can create a record but from that point on cannot do anything with it.
    Any help v much appreciated.
    Thx

    Yes, I've seen similar links/posts about how to activate buttons in the header of a table, but those do it by adding listeners to the renderer. My buttons would be directly in the CellRendererPane that is the container for the table header. I would have thought that by putting the button directly in the Cell RendererPane that it would have nothing to do with the rest of the table header. CellRendererPane extends Container. Is it not possible to put a JButton in a Container? JFrame extends indirectly from Container and you can add buttons to that.
    Edited by: Bob.B on Oct 28, 2009 10:57 PM

  • HTTP 400 Error during logoff

    Hi all!
    I have menu Portlet, which just contains URL links. This menu also contains logout URL:
    http://mineserv:port/pls/orasso/orasso.wwsso_app_admin.ls_logout?p_done_url=<logout URL>
    It works most part of time, but sometimes I have error 404:
    The requested URL /pls/orasso/orasso.wwsso_app_admin.ls_logout was not found on this server.
    I don't understand what happens...Can anybody explain me what problem I have. May be I do something wrong...I don't know.
    Thanks and excuse me for my English
    Message was edited by:
    kostik

    In HTTP Server error log I found such message:
    mod_plsql: /pls/portal/PORTAL.wwsec_app_priv.logout HTTP-404 PORTAL.wwsec_app_priv.logout: SIGNATURE (parameter names) MISMATCH VARIABLES IN FORM NOT IN PROCEDURE: P_DONE_URL NON-DEFAULT VARIABLES IN PROCEDURE NOT IN FORM:

  • ABAP Proxy throws HTTP-400 error

    Hi,
    I've created an ABAP Proxy/Enterprise Service in ECC6.0 to consume a webservice that is created in NetWeaver 2004s. Now, when I want to test the proxy, it gives me the error message:
    SOAP:1.007 SRT: Unsupported xstream found: ("HTTP Code 400  : Bad Request")
    The error originates from class CX_AI_SYSTEM_FAULT
    I don't know if it is related to the proxy or with some system settings on ECC 6.0/Netweaver2004s.
    Any help or document reference is appreciated.
    Regards.

    I investigated a little and here are a couple of things you could try:
    - In note 1139406, they are talking about a scenario with HTTP error 404... I realize it is different than the 400 you get, but it may be worth checking if you have a similar problem as described there - it may give a clue what your problem is.
    - Try to check if the endpoint URL to which the request is sent is correct... it may be missing the style parameter, like ?style=document. Go to SOAMANAGER and take a look at the system settings, perhaps there is a wrongly formulated URL that is missing the style parameter.
    Hope this helps a little...

  • Http 400 error

    Hello everyone
    I am getting an http status 400 report
    this is my code
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class HelloWorld extends HttpServlet{
    public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException,IOException{
    response.setContentType("text/html");
    PrintWriter pw = response.getWriter();
    pw.println("<html>");
    pw.println("<head><title>Hello World</title></title>");
    pw.println("<body>");
    pw.println("<h1>Hello World</h1>");
    pw.println("</body></html>");
    this is my xml code
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!--<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd"> -->
    <web-app>
    <servlet>
    <servlet-name>Hello</servlet-name>
    <servlet-class>HelloWorld</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>Hello</servlet-name>
    <url-pattern>/HelloWorld</url-pattern>
    </servlet-mapping>
    </web-app>
    please any one can help me

    this is the error i am getting
    Sep 8, 2008 5:16:25 PM org.apache.catalina.core.AprLifecycleListener init
    INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Apache Software Foundation\Tomcat 6.0\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;D:\app\UK-Dasari\product\11.1.0\db_1\bin;D:\oracle\product\10.2.0\client_1\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files\Common Files\Roxio Shared\DLLShared\;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\;C:\Program Files\Java\jdk1.6.0_05\bin;C:\Program Files\Common Files\Nero\Lib\
    Sep 8, 2008 5:16:25 PM org.apache.coyote.http11.Http11Protocol init
    INFO: Initializing Coyote HTTP/1.1 on http-1020
    Sep 8, 2008 5:16:25 PM org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 1364 ms
    Sep 8, 2008 5:16:25 PM org.apache.catalina.core.StandardService start
    INFO: Starting service Catalina
    Sep 8, 2008 5:16:25 PM org.apache.catalina.core.StandardEngine start
    INFO: Starting Servlet Engine: Apache Tomcat/6.0.10
    Sep 8, 2008 5:16:27 PM org.apache.coyote.http11.Http11Protocol start
    INFO: Starting Coyote HTTP/1.1 on http-1020
    Sep 8, 2008 5:16:27 PM org.apache.jk.common.ChannelSocket init
    INFO: JK: ajp13 listening on /0.0.0.0:8009
    Sep 8, 2008 5:16:27 PM org.apache.jk.server.JkMain start
    INFO: Jk running ID=0 time=0/36 config=null
    Sep 8, 2008 5:16:27 PM org.apache.catalina.startup.Catalina start
    INFO: Server startup in 1480 ms
    Sep 8, 2008 5:17:34 PM org.apache.coyote.http11.Http11Protocol pause
    INFO: Pausing Coyote HTTP/1.1 on http-1020
    Sep 8, 2008 5:17:35 PM org.apache.catalina.core.StandardService stop
    INFO: Stopping service Catalina
    Sep 8, 2008 5:17:35 PM org.apache.coyote.http11.Http11Protocol destroy
    INFO: Stopping Coyote HTTP/1.1 on http-1020
    Sep 8, 2008 9:49:58 PM org.apache.catalina.core.AprLifecycleListener init
    INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Apache Software Foundation\Tomcat 6.0\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;D:\app\UK-Dasari\product\11.1.0\db_1\bin;D:\oracle\product\10.2.0\client_1\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files\Common Files\Roxio Shared\DLLShared\;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\;C:\Program Files\Java\jdk1.6.0_05\bin;C:\Program Files\Common Files\Nero\Lib\
    Sep 8, 2008 9:49:58 PM org.apache.coyote.http11.Http11Protocol init
    INFO: Initializing Coyote HTTP/1.1 on http-1020
    Sep 8, 2008 9:49:58 PM org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 508 ms
    Sep 8, 2008 9:49:58 PM org.apache.catalina.core.StandardService start
    INFO: Starting service Catalina
    Sep 8, 2008 9:49:58 PM org.apache.catalina.core.StandardEngine start
    INFO: Starting Servlet Engine: Apache Tomcat/6.0.10
    Sep 8, 2008 9:49:59 PM org.apache.coyote.http11.Http11Protocol start
    INFO: Starting Coyote HTTP/1.1 on http-1020
    Sep 8, 2008 9:49:59 PM org.apache.jk.common.ChannelSocket init
    INFO: JK: ajp13 listening on /0.0.0.0:8009
    Sep 8, 2008 9:49:59 PM org.apache.jk.server.JkMain start
    INFO: Jk running ID=0 time=0/21 config=null
    Sep 8, 2008 9:49:59 PM org.apache.catalina.startup.Catalina start
    INFO: Server startup in 875 ms

  • HTTP 400 Error - ICM_HTTP_CONNECTION failed

    Hi Experts,
    We are working on E-Filing Interface and while triggering the Proxy in SAP HR System (Sender System) for sending the data to XI, it's giving error System failure HTTP client code 400 reason ICM_HTTP_CONNECTION failed.
    Everything seems fine in the SAP HR system.
    Any help will be highly appreciated.
    Regards,
    Varun

    Are u sure u are running the proxy from the right client in the ECC system... Is ur PI connected to the same client as as the one u are running the test..
    if so then run through the following test in that order -
    All test in ur ECC system
    1) Got to Sxmb_admand ... and see if the role is configured as Business system
    2) See if SICF is maintained...
    3) See if your quesues are registered...SXMB_ADM
    4) See if ur SLD connection are ok...run SLD check...and see if ur own business system is comming up rite...
    here is a link to the initial setup for ECC-Pi connection -
    http://help.sap.com/saphelp_nwpi71/helpdata/en/44/bc8729c60b7006e10000000a155369/frameset.htm
    regards,
    Arvind R

  • HTTP 400 Bad Request Error

    Application Express 3.1.1.00.09
    We have some users who are experiencing what appears to be a browser problem in one of our APEX applications.
    When clicking on any button that does an insert or update to the database some users get an HTTP-400 Bad Request error message. The database does not get updated and anything they click on after that shows that message. In most cases we have been able to restore the user’s browser to the default settings and the issue is resolved. However, we were not able to isolate which browser setting is causing the issue. We have seen the issue in IE 6, IE 7 and IE 8.
    Here’s the error we see in the Apache server error log (minus the date time stamp and IP addresses):
    mod_plsql: /pls/ax_tastest/wwv_flow.accept HTTP-400 Invalid name
    Does anyone else have a solution for this? Know what's causing it?

    HTTP 400 Bad Request Error from APEX 3.1.1.00.09.
    We were able to determine that only PCs which had the Google toolbar installed were getting the HTTP 400 Bad Request Error from a particular page in one of our applications. Further testing revealed that turning off the ‘auto-fill’ feature of the Google toolbar would prevent the error from occurring and the application would behave normally. We were able to identify a specific item on the page that was the root cause. The item was using the type “Text area with HTML Editor” which has been deprecated. We changed the page item type to “HTML editor standard” and this has resolved the issue with or without the Google Toolbar and auto-fill feature enabled.
    Summary:
    •     Browser setting: Google toolbar enabled with auto-fill enabled.
    Apex page item of type: ‘Text area with HTML Editor’.
    When a user clicks on a button in the page, that executes a page process, it results in HTTP 400 error.
    •     Browser setting: Google toolbar enabled with auto-fill disabled.
    Apex page item of type: ‘Text area with HTML Editor’.
    When a user clicks on a button in the page, everything goes through correctly and there is no error.
    •     Browser setting: Google toolbar enabled with auto-fill disabled or enabled.
    Apex page item of type: ‘HTML Editor Standard’.
    When a user clicks on a button in the page, everything goes through correctly and there is no error.

  • Error sending soap request

    Hello!
    I created a simple web service (jax-ws) using NetBeans 5.5 and deployed the web service to the Sun Application Server 9. The integrated function of NetBeans for testing web services works fine. I can also access the wsdl through the internet browser. But a soap request using Altova XMLSpy 2007 fails. The error message states: cannot find dispatch method. But I did exactly the same steps on another machine where the soap request works.
    Any ideas?

    Partially solved. For unknown reasons the soap request is not generated correctly on this machine when using XmlSpy. I just copied the soap request generated by the NetBeans web service test function to XmlSpy and sent it to the server. Works fine.

  • Manual soap request results in SBL-ODU-01009 error

    Hopefully someone can assist here - I am making a manual soap request to which I receive a http 400 -bad request with the SBL-ODU-01009 error in the response header. I cannot find any reference to this error in any of the documentation that I have. Does anyone know what the error means, or know of a place to look for the answer?
    Thank you in advance,
    JJ

    I did a little more sleuthing and realized that the error text was being sent back to me as the body of the http 400 error. The 01009 error is related to a bad or unresolvable namespace in the soap request. So if anyone gets this error, that's what it means. I had a errant space character in the middle of one of my namespace definitions.

  • Http status 400 error in the emulator

    I successfully have run the servlet (ImageAdapter.java). The servlet is suposed to convert GIF images into PNG images according to the clients display settings by using Sun's Jimi packages. It displays both gif and png type images in IE. Now, I am trying to run the midlet (ImageClient.java) in the J2ME toolkit 2.2. It displays the gif image in the emulator. But, when I try to display a png image it gives me a http 400 error. Why is this ? Can anyone help ?
    servlet code: ImageAdapter.java
    import com.sun.jimi.core.*;
    import com.sun.jimi.core.util.*;
    //import com.sun.jimi.util.*;
    import java.awt.*;
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import java.lang.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    * A simple example of a servlet that reads the image from
    * a given URL and uses Jimi to convert it to PNG format,
    * scaling it and recoloring it appropriately for the device.
    * Can be called using either GET or POST.  If GET, then the
    * request parameters are used to determine the URL of the
    * image to fetch and the scaling and color attributes.
    * If POST, the data is sent as UTF-encoded string pairs in the
    * request body.
    public class ImageAdapter extends HttpServlet {
        // The PNG MIME type
        static final String PNG_MIME = "image/png";
        // Convenience method
        static boolean getBooleanProperty( Properties p,
                                           String key,
                                           boolean def ){
            String  sval = p.getProperty( key );
            boolean bval = def;
            if( sval != null ){
                bval = ( sval.equalsIgnoreCase( "true" ) ||
                         sval.equals( "1" ) );
            return bval;
        // Convenience method
        static int getIntegerProperty( Properties p,
                                       String key,
                                       int def ){
            String sval = p.getProperty( key );
            int    ival = def;
            if( sval != null ){
                try {
                    ival = Integer.parseInt( sval );
                catch( NumberFormatException e ){
            return ival;
        // Process GET requests.  Sets up some defaults and then
        // overrides them with the request parameters.
        public void doGet( HttpServletRequest request,
                            HttpServletResponse response )
                throws IOException, ServletException {
            // Put in some defaults for testing with a browser
            Properties props = new Properties();
            props.put( "url",
                 "http://localhost:8080/img/Availability.png" );
            props.put( "colors", "256" );
            props.put( "minwidth", "200" );
            props.put( "maxwidth", "200" );
            props.put( "minheight", "200" );
            props.put( "maxheight", "200" );
            // Overwrite the default with any request parameters...
            Enumeration names = request.getParameterNames();
            while( names.hasMoreElements() ){
                String key = (String) names.nextElement();
                props.put( key, request.getParameter( key ) );
            // Now send back the image...
            adaptImage( props, response );
        // Process POST request.  Parameters are extracted from
        // the request body.
        public void doPost( HttpServletRequest request,
                            HttpServletResponse response )
                throws IOException, ServletException {
            // Get the input stream and read the data...
            ServletInputStream in = request.getInputStream();
            DataInputStream    din = new DataInputStream( in );
            Properties         props = new Properties();
            // Read in properties as sent by client.
            while( true ){
                try {
                    String key = din.readUTF();
                    if( key.length() == 0 ) break;
                    props.put( key, din.readUTF() );
                catch( IOException e ){
                    break;
            din.close();
            adaptImage( props, response );
        // Use Jimi to grab the original image and
        // then scale it and reduce its colors
        // based on the requested settings.
        private void adaptImage( Properties props,
                                 HttpServletResponse response )
                    throws IOException, ServletException {
            // Read in the parameters, with appropriate
            // defaults.
            String imageURL = props.getProperty( "url" );
            if( imageURL == null ){
                response.sendError( response.SC_BAD_REQUEST,
                                   "No 'url' specified" );
                return;
            int minWidth = getIntegerProperty( props,
                                               "minwidth",
                                               0 );
            int maxWidth = getIntegerProperty( props,
                                               "maxwidth",
                                               96 );
            int minHeight = getIntegerProperty( props,
                                                "minheight",
                                                0 );
            int maxHeight = getIntegerProperty( props,
                                                "maxheight",
                                                0 );
            int colors = getIntegerProperty( props,
                                             "colors", 2 );
            boolean dither = getBooleanProperty( props,
                                                 "dither",
                                                 true );
            boolean reduce = getBooleanProperty( props,
                                                 "reduce",
                                                 false );
            // Now read in the image using Jimi...
            URL url;
            try {
                url = new URL( imageURL );
            catch( MalformedURLException e ){
                response.sendError( response.SC_BAD_REQUEST,
                                    "Invalid image URL" );
                return;
            Image img = Jimi.getImage( url, Jimi.SYNCHRONOUS |
                                            Jimi.IN_MEMORY );
            if( img == null ){
                response.sendError( response.SC_BAD_REQUEST,
                                    "Bad image format" );
                return;
            // Now adjust the image, first by
            // scaling it if necessary....
            int     width = img.getWidth( null );
            int     height = img.getHeight( null );
            boolean scale = false;
            if( width < minWidth ){
                width = minWidth;
                scale = true;
            } else if( width > maxWidth){
                width = maxWidth;
                scale = true;
            if( height < minHeight ){
                height = minHeight;
                scale = true;
            } else if( height > maxHeight ){
                height = maxHeight;
                scale = true;
            if( scale ){
                img = img.getScaledInstance( width, height,
                           Image.SCALE_SMOOTH );
                GraphicsUtils.waitForImage( img );
            // Now adjust the color depth...
            if( reduce ){
                ColorReducer reducer = new ColorReducer( colors,
                                                         dither );
                try {
                    img = reducer.getColorReducedImage( img );
                catch( Exception e ){
                    response.sendError( response.SC_BAD_REQUEST,
                                        "Error reducing image" );
                    return;
                GraphicsUtils.waitForImage( img );
            // Convert it to PNG format
            ByteArrayOutputStream bout = new ByteArrayOutputStream();
            try {
                Jimi.putImage( PNG_MIME, img, bout );
            catch( Exception e ){
                response.sendError( response.SC_BAD_REQUEST,
                                    "Error converting image" );
                return;
            byte[] data = bout.toByteArray();
            // Send it out!
            response.setContentType( PNG_MIME );
            response.setContentLength( data.length );
            response.setStatus( response.SC_OK );
            OutputStream out = response.getOutputStream();
            out.write( data );
            out.close();
    }MIDlet code: ImageClient.java
    import java.io.*;
    import javax.microedition.io.*;
    import javax.microedition.lcdui.*;
    import javax.microedition.midlet.*;
    * A MIDP application that fetches and displays an arbitrary
    * image from the Web using the ImageAdapter servlet.
    * This class depends on HttpConnectionHelper, described
    * in an earlier J2ME Tech Tip.
    public class ImageClient extends MIDlet
                             implements CommandListener {
        // Adjust this URL appropriately for the adapter...
        private static String adapterURL =
         "http://localhost:8080/img/image";
        // A default image to display...
        private static String defaultURL =
         "http://localhost:8080/img/Availability.png";
    //http://www.w3schools.com/images/ie.gif
        private Display display;
        private Command exitCommand = new Command( "Exit",
                                                   Command.EXIT, 1 );
        private Command okCommand   = new Command( "OK", Command.OK, 1 );
        private Command sendCommand = new Command( "Get",
                                                   Command.OK, 1 );
        private TextBox entryForm;
        private int     screenHeight;
        private int     screenWidth;
        private int     numColors;
        public ImageClient(){
        protected void destroyApp( boolean unconditional )
                           throws MIDletStateChangeException {
            exitMIDlet();
        protected void pauseApp(){
        protected void startApp()
                          throws MIDletStateChangeException {
            if( display == null ){ // first time called...
                initMIDlet();
        // First we display the dummy canvas so we can
        // get information about the display
        private void initMIDlet(){
            display = Display.getDisplay( this );
            entryForm = new EntryForm();
            display.setCurrent( new DummyCanvas() );
        public void exitMIDlet(){
            notifyDestroyed();
        public void commandAction( Command c, Displayable d ){
            if( c == sendCommand ){
                StatusForm f =
                    new StatusForm( entryForm.getString() );
                display.setCurrent( f );
                f.start();
            } else if( c == okCommand ){
                display.setCurrent( entryForm );
            } else {
                exitMIDlet();
        // A dummy canvas to get the size of the screen
        class DummyCanvas extends Canvas {
            protected void paint( Graphics g ){
                screenHeight = getHeight();
                screenWidth  = getWidth();
                numColors    = display.numColors();
                // Go directly to the main screen
                display.setCurrent( entryForm );
        // The text entry form...
        class EntryForm extends TextBox {
            EntryForm(){
                super( "Enter a URL", defaultURL, 80, 0 );
                addCommand( exitCommand );
                addCommand( sendCommand );
                setCommandListener( ImageClient.this );
        // Show the image...
        class ShowImage extends Canvas {
            ShowImage( byte[] imageData ){
                image = Image.createImage( imageData, 0,
                                           imageData.length );
                display.setCurrent( this );
                addCommand( okCommand );
                setCommandListener( ImageClient.this );
            protected void paint( Graphics g ){
                g.drawImage( image, 0, 0,
                             g.TOP | g.LEFT );
            private Image image;
        // A status for for displaying messages as the data is sent...
        class StatusForm extends Form
                     implements Runnable,
                                HttpConnectionHelper.Callback {
            StatusForm( String url ){
                super( "Status" );
                try {
                    ByteArrayOutputStream bout =
                                new ByteArrayOutputStream();
                    DataOutputStream      dout =
                                new DataOutputStream( bout );
                    // Write info about the image and the
                    // display settings for this device
                    dout.writeUTF( "url" );
                    dout.writeUTF( url );
                    writeInt( dout, "minwidth", screenWidth );
                    writeInt( dout, "maxwidth", screenWidth );
                    writeInt( dout, "minheight", screenHeight );
                    writeInt( dout, "maxheight", screenHeight );
                    writeInt( dout, "colors", numColors );
                    writeInt( dout, "reduce", 1 );
                    writeInt( dout, "dither", 1 );
                    dout.writeUTF( "" );
                    data = bout.toByteArray();
                    dout.close();
                catch( IOException e ){
                    // should handle this....
            void writeInt( DataOutputStream dout, String key,
                           int value ) throws IOException {
                dout.writeUTF( key );
                dout.writeUTF( Integer.toString( value ) );
            // Updates the display.
            void display( String text ){
                if( message == null ){
                    message = new StringItem( null, text );
                    append( message );
                } else {
                    message.setText( text );
            // We're done.
            void done( String msg ){
                display( msg != null ? msg : "Done." );
                addCommand( okCommand );
                setCommandListener( ImageClient.this );
            // Callback for making the HTTP connection.
            public void prepareRequest( String originalURL,
                           HttpConnection conn ) throws IOException
                conn.setRequestMethod( HttpConnection.POST );
                conn.setRequestProperty( "User-Agent",
                  "Profile/MIDP-2.0 Configuration/CLDC-1.1" );
                conn.setRequestProperty( "Content-Language",
                  "en-US" );
                conn.setRequestProperty( "Accept", "image/png" );
                conn.setRequestProperty( "Connection", "close" );
                conn.setRequestProperty( "Content-Length",
                  Integer.toString( data.length ) );
                OutputStream os = conn.openOutputStream();
                os.write( data );
                os.close();
            // Do the connection on a separate thread to keep the UI
            // responsive...
            public void run(){
                HttpConnection conn = null;
                display( "Obtaining HttpConnection object..." );
                try {
                    conn =
                      HttpConnectionHelper.connect( adapterURL,
                                                    this );
                    display( "Connecting to the server..." );
                    int rc = conn.getResponseCode();
                    if( rc == HttpConnection.HTTP_OK ){
                        try {
                            DataInputStream din = new DataInputStream(
                                                conn.openInputStream() );
                            data = new byte[ (int) conn.getLength() ];
                            din.readFully( data );
                            din.close();
                        catch( IOException e ){
                        done( "Image received" );
                        new ShowImage( data );
                    } else {
                        done( "Unexpected return code: " + rc );
                    conn.close();
                catch( IOException e ){
                    done( "Exception " + e +
                          " trying to connect." );
            // Starts the upload in the background...
            void start(){
                display( "Starting..." );
                Thread t = new Thread( this );
                try {
                    t.start();
                catch( Exception e ){
                    done( "Exception " + e +
                          " trying to start thread." );
            private StringItem message;
            private byte[]     data;
    }Regards,
    Ship.

    I have the same problem and I don`t found info about this. How do you solved this problem.

  • Exchange 2013 + 2007 OWA coexistance not redirecting properly (HTTP 400)

    Hello.  I am using this document to funnel our new Exchange 2013 external traffic through an IIS ARR reverse proxy, much like we already do for MIcrosoft
    Lync 2013 on this machine.  
    http://blogs.technet.com/b/exchange/archive/2013/08/02/part-2-reverse-proxy-for-exchange-server-2013-using-iis-arr.aspx
    I followed this guide to a T. especially the part on the page 2 that I linked above about creating the legacy.domain.com server farm and URL rewrite rule.  This
    IIS ARR proxy seems to work fine for Outlook Anywhere, ActiveSync, OWA if the user's mailbox is on the Exchange 2013 server, but it does not work if an OWA user logs in with a mailbox on 2007.
    When the user has a mailbox on 2007, after logging into OWA they get HTTP 400 error.  The URL bar in the browser is changed to https://legacy.domain.com/owa/auth/owaauth.dll
    The Exchange 2007 server IIS logs show this:
    70.x.x.x, -, 11/1/2014, 9:45:48, W3SVC1, MAIL, 10.1.1.3, 0, 523, 132, 400, 0, POST, /owa/auth/owaauth.dll, -,
    I can't figure out why this is happening.  DNS is correct.  legacy.domain.com points to the 2007 Exchange server.  webm.domain.com points to the
    Exchange 2013 server.
    Any ideas?

    Doing more testing, I almost think the Exchange 2007 server keeps redirecting.  So the HTTP 400 is because when you hit legacy.domain.com, it redirects
    to webm.domain.com which redirects back to legacy.domain.com and vice versa.
    I put a test.txt file in the Exchange 2007 owa virtual directory and I cannot access it in any browser.  I tried https://legacy.domain.com/owa/test.txt and
    It redirects me to https://webm.domain.com(Exchange 2013).  I can however go
    one level (or more) deep on the legacy server and get a file such as https://legacy.doamin.com/owa/8.3.342.1/themes/base/logon.css and
    in the browser I see the code (both externally AND internally, so I know DNS and firewall is working).
    I can't find anywhere on IIS 6.0 on the Exchange 2007 server where any kind of redirection is taking place though.  Virtual Directory properies for owa say
    "A directory located on this computer: "C:\Program Files\Microsoft\Exchange Server\ClientAccess\owa"  Enable default content page is checked with default.aspx but I looked at default.aspx in notepad and I don't see ANY code telling it to
    redirect.
    In Exchange 2007 management console OWA internal URL and External URL both sayhttps://legacy.domain.com/owa .
    I have no idea what is causing this redirection.  I did an iisreset and also recycled the OwaAppPool and no change.

Maybe you are looking for