Http.request containing file.

If I have a web page with a file upload form.
And then server side reads the core HTTP-Request data, how can i then take out the file from that.
Ofcause i can see it a little bit my self, my problem is if the file contains the 0D 0A how can I then know when the file ends.
e.g. If i upload a file containing the following 6 bytes: 22 22 0D 0A 22 22 called "22Linjeskift22.dat". The http request will look as follows:
000000000 : 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D  ; ----------------
000000016 : 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 37 64 35  ; -------------7d5
000000032 : 31 37 37 33 32 30 31 36 30 0D 0A 43 6F 6E 74 65  ; 177320160XXConte
000000048 : 6E 74 2D 44 69 73 70 6F 73 69 74 69 6F 6E 3A 20  ; nt-Disposition:
000000064 : 66 6F 72 6D 2D 64 61 74 61 3B 20 6E 61 6D 65 3D  ; form-data; name=
000000080 : 22 5F 5F 56 49 45 57 53 54 41 54 45 22 0D 0A 0D  ; "__VIEWSTATE"XXX
000000096 : 0A 64 44 77 74 4E 6A 55 30 4D 7A 63 79 4D 54 6B  ; XdDwtNjU0MzcyMTk
000000112 : 31 4F 7A 73 2B 58 54 32 54 44 71 78 4C 2F 4E 52  ; 1Ozs+XT2TDqxL/NR
000000128 : 6A 67 48 4A 39 75 55 42 4C 38 57 69 35 36 71 59  ; jgHJ9uUBL8Wi56qY
000000144 : 3D 0D 0A 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D  ; =XX-------------
000000160 : 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D  ; ----------------
000000176 : 37 64 35 31 37 37 33 32 30 31 36 30 0D 0A 43 6F  ; 7d5177320160XXCo
000000192 : 6E 74 65 6E 74 2D 44 69 73 70 6F 73 69 74 69 6F  ; ntent-Dispositio
000000208 : 6E 3A 20 66 6F 72 6D 2D 64 61 74 61 3B 20 6E 61  ; n: form-data; na
000000224 : 6D 65 3D 22 4D 41 58 5F 46 49 4C 45 5F 53 49 5A  ; me="MAX_FILE_SIZ
000000240 : 45 22 0D 0A 0D 0A 31 30 30 30 0D 0A 2D 2D 2D 2D  ; E"XXXX1000XX----
000000256 : 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D  ; ----------------
000000272 : 2D 2D 2D 2D 2D 2D 2D 2D 2D 37 64 35 31 37 37 33  ; ---------7d51773
000000288 : 32 30 31 36 30 0D 0A 43 6F 6E 74 65 6E 74 2D 44  ; 20160XXContent-D
000000304 : 69 73 70 6F 73 69 74 69 6F 6E 3A 20 66 6F 72 6D  ; isposition: form
000000320 : 2D 64 61 74 61 3B 20 6E 61 6D 65 3D 22 75 73 65  ; -data; name="use
000000336 : 72 66 69 6C 65 22 3B 20 66 69 6C 65 6E 61 6D 65  ; rfile"; filename
000000352 : 3D 22 43 3A 5C 44 6F 63 75 6D 65 6E 74 73 20 61  ; ="C:\Documents a
000000368 : 6E 64 20 53 65 74 74 69 6E 67 73 5C 65 73 6B 65  ; nd Settings\eske
000000384 : 5C 4D 79 20 44 6F 63 75 6D 65 6E 74 73 5C 4D 79  ; \My Documents\My
000000400 : 20 50 69 63 74 75 72 65 73 5C 75 70 6C 6F 61 64  ;  Pictures\upload
000000416 : 54 65 73 74 5C 32 32 4C 69 6E 6A 65 73 6B 69 66  ; Test\22Linjeskif
000000432 : 74 32 32 2E 64 61 74 22 0D 0A 43 6F 6E 74 65 6E  ; t22.dat"XXConten
000000448 : 74 2D 54 79 70 65 3A 20 74 65 78 74 2F 70 6C 61  ; t-Type: text/pla
000000464 : 69 6E 0D 0A 0D 0A 22 22 0D 0A 22 22 0D 0A 2D 2D  ; inXXXX""XX""XX--
000000480 : 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D  ; ----------------
000000496 : 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 37 64 35 31 37  ; -----------7d517
000000512 : 37 33 32 30 31 36 30 2D 2D 0D 0A  ; 7320160--XXIf then i want to extract the file from this data, then i don�t know how to handle this situation where the file itself contains the 0D 0A, data.
What can i Do,
Best Regards, and thx if someone can help.

I would encourage you to not re-invent the wheel but rather use something like Apache Commons FileUpload (http://jakarta.apache.org/commons/fileupload/) to parse the HTTP stream.

Similar Messages

  • Java service invocation with HTTP Request

    A simple HTTP Request containing the SOAP envelope is a valid way of calling a web service, right?
    It seems simpler and more efficient than the "traditional" ways (Axis, JAX-RPC, etc), so what are the disadvantages?
    Thanks in advance
    Pedro

    kept the jars under APP-INF/lib

  • Problems by getting info out of XML file with a HTTP request

    Hi,
    I have a litte question. I'm working on an application that works together with google maps. In my java code, I get general information about address out of one database table, and I want to add some geographic information like coordinates that I want to retrieve from Google Maps through HTTP:
    Right now my code is like:
    while (resultSet.next())
                             title = resultSet.getString("title").replaceAll("'","''").toUpperCase();
                             author = resultSet.getString("author").replaceAll("'","''").toUpperCase();
                             location = resultSet.getString("location").replaceAll("'","''").toUpperCase();
                             straatnaam = resultSet.getString("straatnaam").replaceAll("'","''").toUpperCase();
                             nummer = resultSet.getString("nummer");
                             landcode = resultSet.getString("landcode").replaceAll("'","''").toUpperCase();
                             address = straatnaam + " " + nummer + " , " + location + " " + landcode;
                             url = "http://maps.google.com/maps/geo?q=" + address + "&output=xml&key=+key+";
                             String query = "INSERT INTO data2 VALUES ('" + i + "','" + title + "','" + author + "','" + resultSet.getString("date1") + "','" + resultSet.getString("date2") + "','" + location + "','" + resultSet.getString("postcode") + "','" + straatnaam + "','" + resultSet.getString("nummer") + "','" + landcode + "','+something like url.getCoordX+','something like url.getCoordY')";
                             success = sql2.executeUpdate(query);
                             i++;
    Now I don't know how I can handle that. Is it possible to do an HTTP request in Java without using Java Script of servlets? I just want to get the X and Y coordinates out of the XML file.
    The XML file will be something like:
    <kml xmlns="http://earth.google.com/kml/2.0">
    <Response>
    <name>1600 amphitheatre mountain view ca</name>
    <Status>
    <code>200</code>
    <request>geocode</request>
    </Status>
    <Placemark>
    <address>
    1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA
    </address>
    <AddressDetails Accuracy="8">
    <Country>
    <CountryNameCode>US</CountryNameCode>
    <AdministrativeArea>
    <AdministrativeAreaName>CA</AdministrativeAreaName>
    <SubAdministrativeArea>
    <SubAdministrativeAreaName>Santa Clara</SubAdministrativeAreaName>
    <Locality>
    <LocalityName>Mountain View</LocalityName>
    <Thoroughfare>
    <ThoroughfareName>1600 Amphitheatre Pkwy</ThoroughfareName>
    </Thoroughfare>
    <PostalCode>
    <PostalCodeNumber>94043</PostalCodeNumber>
    </PostalCode>
    </Locality>
    </SubAdministrativeArea>
    </AdministrativeArea>
    </Country>
    </AddressDetails>
    <Point>
    <coordinates>-122.083739,37.423021,0</coordinates>
    </Point>
    </Placemark>
    </Response>
    </kml>
    many greetings and thanks in advance
    Mathias

    Hi, sorry for being not so clear. My question was actually if it is possible to do a HTTP request in Java without using servlets or being in Java Script. Actually my question was more specific for Google maps, because it didn't seem to work. It was my mistake, and already solved, to forget to make the webservice-call "URL-encoded". Because of that, I always received a HTTP 400 error, and that's why I thought it wouldn't be possible.
    But now I have another, perhaps for you guys stupid question. The result I get from the webservice URL is of the form:
    <?xml version="1.0" encoding="UTF-8"?>
    <kml xmlns="http://earth.google.com/kml/2.0">
    <Response>
         <name>nieuwelaan 38, Hamme</name>
         <Status>
              <code>200</code>
              <request>geocode</request>
         </Status>
         <Placemark id="p1">
              <address>Nieuwelaan 38, 9220 Hamme, Hamme, Belgium</address>
              <AddressDetails Accuracy="8" xmlns="urn:oasis:names:tc:ciq:xsdschema:xAL:2.0">
              <Country>
                   <CountryNameCode>BE</CountryNameCode>
                   <AdministrativeArea>
                        <AdministrativeAreaName>Vlaams Gewest</AdministrativeAreaName>
                        <SubAdministrativeArea>
                             <SubAdministrativeAreaName>Oost-Vlaanderen</SubAdministrativeAreaName>
                             <Locality>
                                  <LocalityName>Hamme</LocalityName>
                                  <DependentLocality>
                                       <DependentLocalityName>Hamme</DependentLocalityName>
                                       <Thoroughfare>
                                            <ThoroughfareName>Nieuwelaan 38</ThoroughfareName>
                                       </Thoroughfare>
                                       <PostalCode>
                                            <PostalCodeNumber>9220</PostalCodeNumber>
                                      </PostalCode>
                                 </DependentLocality>
                            </Locality>
                        </SubAdministrativeArea>
                   </AdministrativeArea>
             </Country>
             </AddressDetails>
             <Point>
                   <coordinates>4.126295,51.097724,0</coordinates>
             </Point>
         </Placemark>
    </Response>
    </kml> Now I want to get the value of the coordinates field.
    This is my code:
    address = URLEncoder.encode(address, "UTF-8");
    urlString = "http://maps.google.com/maps/geo?q=" + address + "&output=xml&key=ABQIAAAA9fEXNK-q6vKpPU0JCmPPkxQjbVBpjtblJJYkDfbMo0e51afwehRmujfvBtJqx1Qehg6e6QgCRY8poA";
    url = new URL(urlString);
    XPath xPath = XPathFactory.newInstance().newXPath();
    Document domDoc = processData(url);
    path = "/kml/Response/Placemark/Point/coordinates";
    coord = xPath.evaluate(path, domDoc);
    System.out.println("coord : " + coord);Now, in the last line, by writing out the value of coord to my screen, I get the value "1", instead of "4.126295,51.097724,0" I would expect, anyone knows what I'm doing wrong?
    greetings
    Mathias

  • File.upload on Air SDK for iOS devices failed to send http request to server.

    I am trying to use ActionScript's File.upload to upload a file on Air SDK for iOS8 environment, but the File.upload does not work properly. No handler about the file upload is executed after File.upload is invoked, and no exception is caught. When I check the network traffic of the server side, I found that no http request even hit the server after File.upload is executed. The code snippet here is very simple.
      private var file:File;
      private var dir:File;
      //This method is executed to create a file and upload it when the Upload Button is pressed.
      protected function OnUploadButtonPressed(event:MouseEvent):void{
      var str:String = 'This is test';
      var imageBytes:ByteArray = new ByteArray();
      for ( var i:int = 0; i < str.length; i++ ) {
      imageBytes.writeByte( str.charCodeAt(i) );
      try{
      dir = File.applicationStorageDirectory
      var now:Date = new Date();
      var filename:String = "test" + now.seconds + now.milliseconds + ".txt";
      file = dir.resolvePath( filename );
      var stream:FileStream = new FileStream();
      stream.open( file, FileMode.WRITE );
      stream.writeBytes( imageBytes );
      stream.close();
      file.addEventListener( Event.COMPLETE, uploadComplete );
      file.addEventListener( IOErrorEvent.IO_ERROR, ioError );
      file.addEventListener( SecurityErrorEvent.SECURITY_ERROR, securityError );
      file.addEventListener(ErrorEvent.ERROR, someError);
      file.addEventListener(ProgressEvent.PROGRESS, onProgress);
      file.upload( new URLRequest("http://10.60.99.31/MyPath/fileUploadTest.do"));//This line does not work. No handler is executed. No http request hit the server side.
      } catch( e:Error ) {
      trace( e );
      //Complete Handler
      private function uploadComplete( event:Event ):void
      trace( "Upload successful." );
      //IOError handler
      private function ioError( error:IOErrorEvent ):void
      trace( "Upload failed: " + error.text );
      //SecurityError handler
      private function securityError(error:SecurityErrorEvent):void{
      trace( "Security error:" + error.text );
      //Other handler
      private function someError(error:ErrorEvent):void{
      trace("some error" + error.text);
      //Progress handler
      private function onProgress(event:ProgressEvent):void{
      trace("progressHandler");
    When executed on Air Simulator, it works fine as expected, and the file is successfully uploaded to the server. But When executed on iOS devices(in my case, iPad), as I explain early, no handler about the file upload is executed, and no the http request even hit the server. So I think the problem may be in the client side. It seems that the Air SDK for iOS just failed to send the http request for some reason.
    To make my problem more clear, I list my environment below:
    Development Environment:  Windows7 (64bit)  / Mac os 10.9.4 (Tested on  OS platforms.)
    IDE: Flash Builder 4.7
    Air SDK:  3.8 / 16.0.0 (After I updated to the lastest Air SDK 16.0.0 , the problem still exists.)
    Application Server:  Tomcat7 + Spring
    Target OS: iOS 8
    I have been struggling for this for days. So I really appreciate it if anyone has any idea about this.
    Thanks in advance.

    Hi bluewindice ,
    As you have quoted ( ActionScript's File.upload does not work on Air SDK for iOS devices ) , this issue has been replicated at our end, and our team will be working on it.
    Thanks,
    Tushar

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

  • Accessing a .exe file with HTTP Request

    Hi!
    Can I access an executable file located in a WEB page with JMeter?
    I'm tryng to use a HTTP Request:
    Server Name or IP: 111.111.111.1
    Port Number: 8080
    Path: /cliente/file.exe
    The file is in a Tomcat application.
    When I run, in the View Results Tree - Sampler Result, it shows:
    Load time: 63
    HTTP response code: 400
    HTTP response message: Bad Request
    HTTP response headers:
    HTTP/1.1 400 Bad Request
    Date: Wed, 27 Apr 2005 14:26:09 GMT
    Server: Apache-Coyote/1.1
    Connection: close
    I already had copied the link and placed it into the browser to verify
    if it was correct and i had access to the file normaly.
    What am I doing wrong?
    Thanks in advance.
    Marcelo.

    If the .exe file is publically-accessible from your web server (like other normal .html files are for example), then accessing that resource would be done the same way as accessing others (get a stream of bytes that the server would serve up, and do something with those bytes on the client end of the connection). I don't know what JMeter has to do with that.

  • Reduce http requests on SP 2010 master page - Combine/Minify js, css files

    Hi
    We've developed a highly custom intranet site on top of SharePoint 2010.  We want to reduce the amount of http requests being performed on certain pages, like the master page.  Whats the best way of doing this?
    Any one used Cassette?

    Regarding cassette:
    http://social.msdn.microsoft.com/Forums/en-US/06befe57-bdfd-4335-b8f3-95ff6f68ec9e/using-cassette-with-sharepoint-2010?forum=sharepointdevelopmentprevious
    You can enable blob cache so that css and js file are stored on server and not pulled from database
    Also you can try :
    http://sharepointroot.com/2008/12/07/improving-sharepoint-performance-publishing/
    http://sharepointpromag.com/sharepoint/15-helpful-sharepoint-branding-tips

  • Server keeps refusing HTTP request while uploading file

    Hello, I have written an applet that uses sockets to communicate with HTTP server. I use following string to send a HTTP request to a server:
    req = "POST /!pages/upload.php HTTP/1.1\r\n";
        req += "Host: www.austyn.sk\r\nUser-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; sk; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6\r\n";
        req += "Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5\r\n";
        req += "Accept-Language: sk,cs;q=0.8,en-us;q=0.5,en;q=0.3\r\n";
        req += "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n";
        req += "Keep-Alive: 300\r\n";
        req += "Connection: keep-alive\r\n";
        req += "Referer: http://www.upnito.sk/\r\n";
        req += "Content-Length: 500\r\n";
        req += "Content-Type: multipart/form-data;boundary=007\r\n";
        req += "--007\r\n";
        req += "Content-Disposition: form-data; name=\"subor\"; filename=\"msvcp80.txt\"\r\n";
        req += "Content-Type: text/plain\r\n\n";
        req += "abcdef\r\n";
        req += "--007--\r\n\r\n";I get response like this:
    HTTP/1.1 400 Bad Request
    Date: Sat, 15 Sep 2007 14:24:42 GMT
    Server: Apache/2.0.55 (Ubuntu) PHP/5.1.2 mod_ssl/2.0.55 OpenSSL/0.9.8a
    Content-Length: 297
    Connection: close
    Content-Type: text/html; charset=iso-8859-1
    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    <html><head>
    <title>400 Bad Request</title>
    </head><body>
    <h1>Bad Request</h1>
    <p>Your browser sent a request that this server could not understand.<br />
    Request header field is missing ':' separator.<br />
    <pre>
    --007</pre>
    </p>
    </body></html>I think that my request should be alright. I used the Live HTTP headers extension on Firefox and even a packet sniffer to get the entire communication between server and client during HTTP upload and I wrote the request string according to that. It seems, that the server doesn't like the first boundary --007, which marks the beginning of the form element..
    So what's wrong with that request string?
    Edited by: whitewash on Sep 15, 2007 7:28 AM

    on some other links people are saying to add this line for solving this problem :
    "java -DHTTPClient.log.file=httpclient.log -DHTTPClient.forceHTTP_1.0=true -DHTTPClient.disableKeepAlives=true -DHTTPClient.dontTimeoutRespBody=true"
    does nyone know what to do with this line....where to add this??....
    FYI i am using weblogic server

  • SBL-ODU-01007 - The HTTP request did not contain a valid SOAPAction header

    I am trying to insert a Lead using the following XML
    SOAPAction: "document/urn:crmondemand/ws/ecbs/lead/10/2004:LeadInsert"
    URL: https://secure-ausomxbia.crmondemand.com/Services/Integration
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:ns2="urn:crmondemand/ws/ecbs/lead/10/2004" xmlns:ns3="urn:/crmondemand/xml/Lead/Data">
    <env:Header>
    <ns1:Security>
    <ns1:UsernameToken>
    <ns1:Username>****</ns1:Username>
    <ns1:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">****</ns1:Password>
    </ns1:UsernameToken>
    </ns1:Security>
    </env:Header>
    <env:Body>
    <ns2:LeadInsert_Input>
    <ns3:ListOfLead lastpage="true" recordcount="1">
    <ns3:Lead>
    <ns3:ExternalSystemId>3232323</ns3:ExternalSystemId>
    <ns3:LeadFirstName>soap</ns3:LeadFirstName>
    <ns3:LeadLastName>test</ns3:LeadLastName>
    </ns3:Lead>
    </ns3:ListOfLead>
    <ns2:Echo>off</ns2:Echo>
    </ns2:LeadInsert_Input>
    </env:Body>
    </env:Envelope>
    I am getting following response.
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
    <soap:Fault>
    <faultcode>soap:Client</faultcode>
    <faultstring>Client</faultstring>
    <detail>
    <ErrorCode>SBL-ODU-01007</ErrorCode>
    <ErrorMessage>The HTTP request did not contain a valid SOAPAction header. The value of the header was </ErrorMessage>
    </detail>
    </soap:Fault>
    </soap:Body>
    </soap:Envelope>
    I have checked the URL and SOAPAction seem to be correct, can somebody please let me know what can be the problem.
    Thanks.

    I am trying to insert a Lead using the following XML
    SOAPAction: "document/urn:crmondemand/ws/ecbs/lead/10/2004:LeadInsert"
    URL: https://secure-ausomxbia.crmondemand.com/Services/Integration
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:ns2="urn:crmondemand/ws/ecbs/lead/10/2004" xmlns:ns3="urn:/crmondemand/xml/Lead/Data">
    <env:Header>
    <ns1:Security>
    <ns1:UsernameToken>
    <ns1:Username>****</ns1:Username>
    <ns1:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">****</ns1:Password>
    </ns1:UsernameToken>
    </ns1:Security>
    </env:Header>
    <env:Body>
    <ns2:LeadInsert_Input>
    <ns3:ListOfLead lastpage="true" recordcount="1">
    <ns3:Lead>
    <ns3:ExternalSystemId>3232323</ns3:ExternalSystemId>
    <ns3:LeadFirstName>soap</ns3:LeadFirstName>
    <ns3:LeadLastName>test</ns3:LeadLastName>
    </ns3:Lead>
    </ns3:ListOfLead>
    <ns2:Echo>off</ns2:Echo>
    </ns2:LeadInsert_Input>
    </env:Body>
    </env:Envelope>
    I am getting following response.
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
    <soap:Fault>
    <faultcode>soap:Client</faultcode>
    <faultstring>Client</faultstring>
    <detail>
    <ErrorCode>SBL-ODU-01007</ErrorCode>
    <ErrorMessage>The HTTP request did not contain a valid SOAPAction header. The value of the header was </ErrorMessage>
    </detail>
    </soap:Fault>
    </soap:Body>
    </soap:Envelope>
    I have checked the URL and SOAPAction seem to be correct, can somebody please let me know what can be the problem.
    Thanks.

  • SBL-ODU-01008 The HTTP request did not contain well-formed XML.

    I am trying to invoke the activity webservice using Msxml2.XMLHTTP.4.0 through PowerBuilder...
    I receive the following error when executing the code below: SBL-ODU-01008 The HTTP request did not contain well-formed XML.
    ls_post_url = "https://secure-ausomxxxx.crmondemand.com/Services/Integration/Activity;"
    ls_response_text = "jsessionid=" + sesId + ";"
    ls_post_url = ls_post_url + ls_response_text
         loo_xmlhttp.open ("POST",ls_post_url, false)
    // loo_xmlhttp.setRequestHeader("Content-Length", 200 )      
    // loo_xmlhttp.setRequestHeader("Content-Type", "text/xml; charset=utf-8" )      
    // loo_xmlhttp.setRequestHeader("Accept", "text/xml" )           
    // loo_xmlhttp.setRequestHeader("COOKIE", left(cookie,pos(cookie,";",1)-1) )
    //     loo_xmlhttp.setRequestHeader("COOKIE", left(cookie,pos(cookie,";",1)-1) )
         ls_post_url2 = "document/urn:crmondemand/ws/ecbs/activity/10/2004:ActivityQueryPage"
         loo_xmlhttp.setRequestHeader("SOAPAction", ls_post_url2)     
         loo_xmlhttp.send()
    If I uncomment the setRequestHeader info, then I get a different error:
    ls_post_url = "https://secure-ausomxxxx.crmondemand.com/Services/Integration/Activity;"
    ls_response_text = "jsessionid=" + sesId + ";"
    ls_post_url = ls_post_url + ls_response_text
         loo_xmlhttp.open ("POST",ls_post_url, false)
    loo_xmlhttp.setRequestHeader("Content-Length", 200 )      
    loo_xmlhttp.setRequestHeader("Content-Type", "text/xml; charset=utf-8" )      
    loo_xmlhttp.setRequestHeader("Accept", "text/xml" )           
    loo_xmlhttp.setRequestHeader("COOKIE", left(cookie,pos(cookie,";",1)-1) )
         loo_xmlhttp.setRequestHeader("COOKIE", left(cookie,pos(cookie,";",1)-1) )
         ls_post_url2 = "document/urn:crmondemand/ws/ecbs/activity/10/2004:ActivityQueryPage"
         loo_xmlhttp.setRequestHeader("SOAPAction", ls_post_url2)     
         loo_xmlhttp.send()
    SBL-ODU-01007 The HTTP request did not contain a valid SOAPAction header. The value of the header was
    I am unsure what I am missing in order to invoke the web service. If anyone can help I would truly appreciate it.
    Thanks

    Hi,
    I tried the SOAP request you provided and got a different error response:
    <?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><soap:Fault><faultcode>soap:Client</faultcode><faultstring>Client</faultstring><detail><ErrorCode>SBL-ODU-01008</ErrorCode><ErrorMessage>The HTTP request did not contain well-formed XML. An attempt to parse it produced the following error: Unsupported wsse:Password Type. Valid Value: http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText</ErrorMessage></detail></soap:Fault></soap:Body></soap:Envelope>
    After changing the Password Type from:
    Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wssusername-token-profile-1.0#PasswordText">hijklmno</wsse:Password>
    to:
    Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">hijklmno</wsse:Password>
    The request was successful.
    Please let me know if this resolves your issue.
    Thanks,
    Sean
    <?xml version='1.0' encoding='ISO-8859-1'?>
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Header>
    <wsse:Security
    xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
    soapenv:mustUnderstand="1">
    <wsse:UsernameToken>
    <wsse:Username>abcdefg</wsse:Username>
    <wsse:Password
    Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">hijklmno</wsse:Password>
    </wsse:UsernameToken>
    </wsse:Security>
    </soapenv:Header>
    <soapenv:Body>
    <q0:ContactWS_ContactQueryPage_Input
    xmlns:q0="urn:crmondemand/ws/contact/">
    <q1:ListOfContact xmlns:q1="urn:crmondemand/xml/Contact/Query">
    <Contact>
    <ContactType>='Customer'</ContactType>
    <ContactFirstName>='Fred'</ContactFirstName>
    <IntegrationId />
    </Contact>
    </q1:ListOfContact>
    </q0:ContactWS_ContactQueryPage_Input>
    </soapenv:Body>
    </soapenv:Envelope>
    Edited by: Sean Duffy on Jun 4, 2010 9:38 AM

  • How to send a document in net.HTTP.request as a POST variable?

    I have read and reread the doc on net.HTTP.request, and it says I can pass an argument of oRequest, but I have not succeeded at passing in the current document, which is what I want to do.
    I've tried app.activeDocs[0], or encoding that to a string, but though it makes the call without error, nothing is sent.
    Should oRequest be simply a document, or a variable made up of name-value pairs? How do we send multiple parameters to a POST otherwise?
    I've succeeded fine with calling using GET, but when I tried to pass the document as a GET variable, I got nothing either.
    I'm sending to a LiveCycle REST end point so either POST or GET is fine.
    Thanks!

    POSTing the current document is straightforward *provided* your script is running outside the document context (i.e. in the console or a folder-level script). There's no access from doc-level scripts for obvious reasons.
    For example, putting this in the JS console will POST the current file to a URL:
    Net.HTTP.request({
      cVerb:'POST',
      cURL: 'http://localhost/submit.php',
      oRequest: Collab.documentToStream(this),
      oHandler: {
        response: function (msg, uri, err) {
           if (err!=undefined) app.alert(msg);
    Your problem with talking to a vanilla webservice is that you cannot send the RFC1867 delimeters (i.e. form a "multipart/form-data" request) as the ReadStream object doesn't have a concatenation method in the Acrobat JSAPI. That's also how you would usually prepend other form fields, but if you're careful with your server-side coding you can send those as GET parameters in cURL. Normally you'd be polite and pass a Context-Type header in the aHeaders array - it won't matter to the transmission process but will allow your webservice to predict what the heck it's been sent.
    Your webservice will then have to read the raw data. In PHP for example, you won't get anything in the $_FILES global but you can grab the PDF by reading everything from the input buffer, with the line:
    $pdf = file_get_contents("php://input");
    If that line was in the server script that the above JS code was aimed at, the variable $pdf will contain an exact binary copy of the currently-open document.

  • HTTP Request Error

    Hi Iam using Flex to display pie chart in my application. Im
    getting the pie chart in Mozilla firefox but in IE iam getting Http
    Request Error. Iam giving the code what i wrote. Please find. can
    anybody help me in this? thanks
    mxml file
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" width="300" height="232" backgroundColor="white"
    usePreloader="true">
    <mx:Script>
    <![CDATA[
    import mx.messaging.channels.StreamingAMFChannel;
    import mx.charts.series.LineSeries;
    import mx.rpc.events.ResultEvent;
    import mx.rpc.events.FaultEvent;
    import mx.controls.Alert;
    import mx.controls.*;
    import mx.events.*;
    [Bindable]
    public var orXmlList:XMLList;
    [Bindable]
    public var orXml:XML;
    [Bindable]
    public var orderCount:String = "0";
    private function getOrXML():void{
    orRPC.cancel();
    orRPC.send();
    public function handleXML(event:ResultEvent):void
    orXml = event.result as XML;
    orXmlList = event.result.orderResultsData.order as XMLList;
    var orMetaString:String = "orMeta";
    orderCount = orXml.orderResultsData[0].orMeta[0].orderCount;
    public function handleFault(event:FaultEvent):void
    Alert.show(event.fault.faultString, "Error");
    ]]>
    </mx:Script>
    <mx:HTTPService result="handleXML(event);"
    fault="handleFault(event);" id="orRPC" resultFormat="e4x"
    method="POST" url="/global/corpOrderResults.csc"
    useProxy="true">
    </mx:HTTPService>
    <mx:PieChart x="0" y="46.95" id="orPieChart" width="168"
    height="126" dataProvider="{orXmlList}"
    creationComplete="getOrXML();" showDataTips="true">
    <mx:series>
    <mx:PieSeries nameField="name" field="count" />
    </mx:series>
    </mx:PieChart>
    <mx:Legend dataProvider="{orPieChart}" x="141.25"
    y="56.6" verticalGap="0"/>
    <mx:Label id="orInfoLabel" x="0" y="20.95" text="Orders
    updated in the last 30 days: {orderCount}" width="283.4"
    height="18"/>
    </mx:Application>
    Text
    And my JSp page is:
    <div id="flashcontent">
    </div>
    <script type="text/javascript">
    var so = new SWFObject("/global/flash/litigationByNoc.swf",
    "mymovie", "400", "200", "8", "#336699");
    so.write("flashcontent");
    </script>

    Hi,
    I have checked the logs. I am getting errors like the below:
    1.     com.sap.engine.services.servlets_jsp.server.deploy.impl.exceptions.WCEApplicationNotStartedException: The application [sap.com/com.sap.portal.ivs.iviewservice] is configured to have ALWAYS start up mode. Currently it is in STOPPED status - because of this it will not be started implicitly by the Web Container service and any internal operation that needed this application to be running will fail. There are two possible reasons for STOPPED status: 1) The application failed to start during cluster startup. 2) The application is stopped by system administrator.
    2.     .info.exception.WD4VCRuntimeException: FAILED: process plan id: generatedBindPlan_CWG_UI action: null
    3.     Thread HTTP Worker [2] failed to acquire exclusive lock on client session
    But the data is being processed by the code correctly. I tried printing the final values of the o/p and the values are as expected.

  • Is there a restriction on length of Http request posted to a Iplanet Web Server ?

    I am submitting an Http Request by POST method to my server. The request will be received and forwarded by Iplanet Web Server to a clustered Weblogic environment, which will then be handled by Java Servlets. The problem I am facing is that when the length of the request shoots up to around 2000 bytes, NES doesn't receive and forward the request to Weblogic. There is no fixed cut-off for the length, it keeps fluctuating.
    I observed the following after hitting the server hundreds of times with Http Requests that vary in length.
    1) If length of Request is below 1500 bytes, request always goes through successfully.
    2) In a range of 1500 bytes to 2000 bytes, request fails most of the times. (Around 80 %)
    3) Requests with length above 2000K invariably fail, though it just worked for a 2.4K request on one occasion (out of some 100 hits)
    Note that by "length of request", I mean the data I post through Http Request (I just have a single parameter in Http request having the literal "XML" as key and a well formed XML document as value. That is equivalent to submitting a HTML form just having a text area called "XML" containing a XML document. )
    I presume that the length of actual Http Request is slightly greater than that of XML (probably by around 100 bytes).
    My Iplanet documentation says that the upper limit on the length of a POST Http Request is 64 K, which is way above the value (2-3 K) at which I am facing the problem.

    Hi Ganesh
    Did you check the HTTP Persistent timeout of your server? Check the value which has been set up by default. Try increasing the timeout value and try again.
    follow these steps it might solve your problem:
    (1)Goto Web Server Administration Server, select the server you want to manage.
    (2)Select Preference >> Perfomance Tuning.
    (3)set HTTP Persistent Connection Timeout to your choice (eg 180 sec for three minutes)(note : if you are posting large amount of data or file increase the value accordingly)
    (4) Apply changes and restart the server.
    *Setting the timeout to a lower value, however, may    prevent the transfer of large files as timeout does not refer to the time that the connection has been idle. For example, if you are using a 2400 baud modem, and the request timeout is set to 180 seconds, then the maximum file size that can be transferred before   the connection is closed is 432000 bits (2400 multiplied by 180)
    If this doesnot solve your problem notify me
    regards
    T.Raghulan
    [email protected]

  • HTTP response contains status code 503

    Hi All,
    Im working on File to JDBC scenario using MsAccess.My file is been picked by XI from the sender folder (im using NFS at the sender side), but it is not inserting the data in the table which i have created on the server.
    When i do SXI_MONI , i'm getting a error in call adapter "HTTP response contains status code 503 with the description Service Unavailable Error while sending by HTTP (error code: 503, error text: Service Unavailable)".
    Plz do help me to solve it.
    Thanks,
    Suma

    Hi,
    503 Service unavailable
    this is because of the server is currently unable to handle the request due to a temporary overloading or maintenance of the server. The implication is that this is a temporary condition which will be alleviated after some delay. If known, the length of the delay MAY be indicated in a Retry-After header. If no Retry-After is given, the client SHOULD handle the response as it would for a 500 response.
    Note: The existence of the 503 status code does not imply that a server must use it when becoming overloaded. Some servers may wish to simply refuse the connection.
    you can go for the possible solution as mentioned below:
    Because of J2EE application com.sap.aii.af.ms.app not active
    1. Try to (re)start the application using the Visual Administrator Choose Server --> Services --> Deploy --> View on Application or restart the J2EE engine.
    2. The problem is that not all J2EE services can be started by the J2EE. i.e Start the Visual Administrator and select Server->Services->Deploy in the tree on the left. On the right-hand side, choose the Runtime tab page. You see a tree in the right window with all applications if you select the APPLICATION radio button. Check if they are running, otherwise choose Start. Usually the J2EE engine starts all services automatically.
    3. Refer SAP Note 803145,807000,791655
    4. In Visual Admin, check if all the required services are running and start them, else restart the Java Stack in the XI server.
    /people/krishna.moorthyp/blog/2006/07/23/http-errors-in-xi /people/vinoth.murugaiyan/blog/2007/08/06/how-to-the-change-the-application-stopped-message
    http://help.sap.com/saphelp_nw04/helpdata/en/64/351941edd5ef23e10000000a155106/frameset.htm
    thanq
    krishna

  • Load balancing HTTP requests for an OC4J instance w/multiple JVMs

    Hello everyone,
    I am using OAS 10.1.3.1 and wish to load balance HTTP requests across an OC4J group of one or more OC4J instances, where each like named OC4J instance may have multiple JVMs or it may just have one JVM.
    My mod_oc4j.conf file would contain the following directives :
    Oc4jSelectMethod roundrobin:local
    Oc4jRoutingMode Static
    Oc4JMount /xyz/* xyz
    In the degenerate case, I would like to have an OC4J group with a cluster size of one, and have that one OC4J instance have two or more JVMs. I would like to be able to receive a request within my web application, determine that the JVM that has been sent the request is the wrong JVM to process the request, and then call HttpServletResponse.sendRedirect("/xyz"). Then, when the browser receives the HTTP 302 response and issues the subsequent HTTP request, have that request sent to a different JVM than the previous JVM that issued the sendRedirect().
    What I have seen is that the subsequent request is sent back to the same JVM that issued the sendRedirect(). I also call invalidate() against the HttpSession prior to calling sendRedirect(), but that does not seem to affect the behavior that I see.
    In the full blown case, I would have an OC4J group with a cluster size > 1, and each of those OC4J instances would have at least one JVM. In that case, I wish the sendRedirect() call to allow the subsequent request to be sent to any one of the OC4J instances in the group, and any one of those JVMs within all of those OC4J instances.
    Can anyone verify that my mod_oc4j mount directive is appropriate given the select method and routing mode? What else might I need to do to have a chance to have a different JVM respond to the request that results from a sendRedirect()?
    Thank you,
    Doug

    I should clarify that in the full blown environment, the OC4J instances that form a group will each be housed within a separate OAS instance that resides on its own machine.
    So ideally, a request could be inbound to say OAS instance 1 on machine A, OC4J instance AA, JVM 2, and I need to force a redirect so that the request can actually be serviced by OAS instance 3 on machine C, OC4J instance AA, JVM 1, and I need to be able to call sendRedirect() against an HttpServletResponse from within a JVM until the subsequent request from the browser, Internet Explorer in my case, is serviced by that JVM.
    Thanks,
    Doug

Maybe you are looking for

  • StackOverflowError when creating a new column in jdev TopLink JSF

    Hello everybody, Please if you know, share your knowledge about the below aspect from JSF Toplink. I created tables in db. Table is called DCF. In that table there are many columns, so many that by accident I forgot to put one. So I created Applicati

  • How to restrict executing tcodes in transaction tab for master clients

    This question applies SOLMAN project implementation tools: SOLAR01, SOLAR02 and so on. Our ERP2005 development U50 system has two clients: One is master client 101 where all customizing should take place  but no transactions are allowed second client

  • My Skype to Go Number is registered as Landline as...

    I have unlimied mobile to mobile calling minutes with my carrier. But whenever my friends dialling the skype to go number to speak to my cell phone, which is going directly to a cell number, their carrier is taking their anytime minutes and they are

  • Use of images in templates

    One of the things that has always bothered me about Apex templates is that they use IMG tags (extensively!) instead of pure CSS. This makes it harder to switch look-n-feel by switching stylesheets. Take the example of the Reports Region template in T

  • MIRO - How to block system from posting to 2 different vendors

    Hi, Is there a way in the system to prevent parking/posting an invoice document in MIRO which has multiple Purchase Orders that belong to different vendors? I can't seem to see any configuration settings that would enable the system to display an err