HTTP POST to PHP server problem

Hi, im trying post a long string to php from a MIDLET, but i have some problems. When i send the whole String, my php server cant receive the request (i have not any response), but, if the string that i send is 1/5 from the original, the process is successful correctly. have somebody any idea?
thx

this is my problem, extracted from another topic on this forum:
"Hi everyone.
I have a problem, and hope someone may help me.
My midlet is uploading sizeable data via http POST.
I'm using WTK104, since i need MIDP1.0
The code have been tried on DefaultGrayPhone emulator
and add-on Nokia's Series 60 Emulator.
Both emulators chunck data, however in different ways.
Deafult one simply produces wrong chunk length (possibly a bug),
Nokia's one always chunks by equal offsets of 2016 bytes.
I'm not using flushing, just close. All the data is being send
at once by one output stream write call.
So I believe (after proper investigation) that MIDP will use chunked Transfer-Encoding method whatever
on such sizeable a data as mine is (up to 50KB) and there's no way to override this behaviour.
Here the main problem appears - Apache refuses to accept chunked encoding in request. The corresposnding message is given in error log
*chunked transfer encoding forbidden*. The returned code is 411 - Content-Length requred. I see no way to override this behaviour of Apache. I was trying to upload my data into Zope web-server, which is my primary goal, but it doesn't handle chunked request either.
Has anyone faced the same problem? Who has managed to POST sizeable data from midlet? Which web servers did you use for that?
Any inputs are highly appreciated!
Anton"
Another:
"> So I believe (after proper investigation) that MIDP
will use chunked Transfer-Encoding method whatever
on such sizeable a data as mine is (up to 50KB) and
there's no way to override this behaviour.Is this true? When I try to set the content-length headers and then write a large byte[] to the output stream I got from an HttpConnection, the HttpConnection appears to remove the content-length header altogether and automatically sets the transfer-encoding to chunked.
Note- I am not calling flush on the outputstream, but I am calling httpconnection.getResponseCode, which I believe calls flush on the outputstream.
Abraham"
I have the identical problem.

Similar Messages

  • Using SSL Module to Encrypt HTTP post to external Server

    I would like to know if it's possible for a CSM with its SSL module to receive an HTTP POST from our internal web servers, encrypt that POST w/ SSL, and finally to forward the newly created SSL transmission to a remote external SSL server? If it is possible, is this good practice or is it better to let the web server do the encryption?

    this is possible.
    It is good practice if you do not want to overload your server with the heavy task of encryption/decryption.
    If your server is very powerfull and far from being used to its maximum capacity, you can do it on the server.
    Another advantage of using an SSL module is that the CSM will see your request in clear text and can therefore perform so *smart* loadbalancing before it gets encrypted by the SSL module.
    [ie: cookie stickyness, url hashing, ...]
    Regards,
    Gilles.

  • Synchronous HTTP POST on Asynchronous Server

    I am writing an asynchronous event driven server that must accept synchronous HTTP posts.
    For example:
    - Client sends HTTP POST to server
    - Server fires an internal asynchronous event
    - Some time later, another asynchronous event
    - Server returns an HTTP response
    If I attempt to do this with Servlets, each POST will result in a separate thread that waits for the response. For a high number of posts, this could result in a massive amount of threads. What I would rather happen is that each POST waits for the HTTP response without the server having to waste a thread.
    Is there a way to do this?
    Thanks.
    Chris

    Hi,
    Thanks for the sharing.J
    Jeremy Wu
    TechNet Community Support

  • ICal Server Email invitations HTTP post to SMTP server?

    Hello all - We have an iCal server truing to post HTTP to an external SMTP server for email invitations. In the caldav error log:
    2010-02-11 17:42:20-0800 [-] [caldav-8009] [AuthorizedHTTPGetter,client] [twistedcaldav.scheduling.imip#error] Could not do server-to-imip request : <twistedcaldav.scheduling.imip.ScheduleViaIMip object at 0x102cc8590> Connection was closed cleanly.
    2010-02-11 17:42:27-0800 [-] [caldav-8009] [PooledMemCacheProtocol,client] [twistedcaldav.scheduling.imip#error] Could not do server-to-imip request : <twistedcaldav.scheduling.imip.ScheduleViaIMip object at 0x102cba3d0> iMIP VFREEBUSY REQUESTs not supported.
    In the smtp mail.log:
    Feb 11 15:19:17 ml01vm postfix/smtpd[11981]: warning: non-SMTP command from unkn
    own[X.X.X.X]: POST /inbox HTTP/1.0
    Let me know if I can provide more information. I have reset the iCal email invitation /server settings numerous times with no effect.

    Apparently the answer is Google Calendar.

  • Posting Threads causing server problems too?

    I don't feel sorry for apple at all releasing everything in 24 hours, but I think threads are probably not helping either, but then again I think different server's for web vs. itunes.

    Good grief, if they're using the same servers for these boards as they are for their iTunes hosting, they have bigger problems than some ticked off customers.

  • Starting workflow with HTTP-Post

    Hello,
    like I wrote in Starting workflow with HTTP-Post I have a problem with starting a workflow with a http-post:
    I have an installation of SAP ERP 2005 SR2 IDES on Win2003 SR2 SP2 and want to start a simple workflow with an external application. Therefor I created an elementary test-workflow and set the general task flag so everybody is allowed to start it. So far everything work fine as I start it manually.
    Now I want to start the workflow by an external application over a HTTP-Post as described in
    http://help.sap.com/saphelp_47x200/helpdata/EN/54/de9e3887d6174fe10000009b38f842/content.htm
    I configured the webserver (Customizing Web-Server) as follows:
    Service: WebFlow (Intranet)
    Address: http://192.168.0.216:8000/
    Path: SAP/BC/WORKFLOW_XML/?
    and sent a post via perl to http://192.168.0.216:8000/SAP/BC/WORKFLOW_XML/?protocol=01&localkey=WS99900004
    <?xml version="1.0" ?>
    <WfMessage Version="1.0" xmlns="http://www.wfmc.org/standards/doc/WF-XML">
    <WfMessageHeader>
    <Request ResponseRequired="No">
    <Key>http://192.168.0.216:8000/SAP/BC/WORKFLOW_XML/?protocol=01&localkey=WS99900004</Key>
    </WfMessageHeader>
    <WfMessageBody>
    <CreateProcessInstance.Request StartImmediately="true">
    <ObserverKey>http://192.168.0.224</ObserverKey>
    </CreateProcessInstance.Request>
    </WfMessageBody>
    </WfMessage>
    The Web-Server returns
    C:\FH\SAP\perl-scripte>perl http-post.pl
    HTTP/1.1 200 OK
    Server: SAP Web Application Server (1.0;700)
    Content-Length: 0
    Content-Type: text/plain
    Client-Date: Sun, 01 Jun 2008 11:00:24 GMT
    Client-Peer: 192.168.0.216:8000
    Client-Response-Num: 1
    but it seems that nothing happens.
    I also tried to post the XML via html-form-field with the same result.
    Did I forgot something essential?

    Hello Daniel
    It's 6 years after you posted your question, but I found your post very useful and thought it would be worth updating for future reference.
    I've just managed to trigger a workflow via http.
    URL :
    http://server.domain:8000/sap/bc/workflow_xml?sap-client=110
    Java :
    URL obj = new URL(url);
    URLConnection con = (URLConnection) obj.openConnection();
    String userpass = "username:password";
    String basicAuth = "Basic " + javax.xml.bind.DatatypeConverter.printBase64Binary(userpass.getBytes());
    con.setRequestProperty ("Authorization", basicAuth);
    con.setRequestProperty("Content-type", "text/xml");
    con.setDoOutput(true);
    DataOutputStream wr = new DataOutputStream(con.getOutputStream());
    wr.write( xml.getBytes("UTF-8") );
    wr.flush();
    wr.close();
    You can then read the response.
    I found that until I added the sap_client parameter I couldn't debug in CL_HTTP_WORKFLOW_XML->IF_HTTP_EXTENSION~HANDLE_REQUEST. Then I found that the content type has to be "text/xml".
    I set the xml variable (the data sent to ECC) to :
    <?xml version="1.0" ?>
    <WfMessage Version="SAP.1.0" xmlns="http://www.wfmc.org/standards/doc/WF-XML">
    <WfMessageHeader>
    <Request>
    <ResponseRequired>Yes</ResponseRequired>
    </Request>
    <Key>HTTP://server.domain:8000/SAP/BC/WORKFLOW_XML/?~localkey=WS90000074</Key>
    <Operation>CreateProcessInstance</Operation>
    </WfMessageHeader>
    <WfMessageBody>
    <CreateProcessInstance>
    <Key>HTTP://server.domain:8000/SAP/BC/WORKFLOW_XML/?~localkey=WS90000074</Key>
    <ContextData>
    <YOUR_CONTEXT_VARIABLE>x</YOUR_CONTEXT_VARIABLE>
    </ContextData>
    <StartImmediately>Yes</StartImmediately>
    </CreateProcessInstance>
    </WfMessageBody>
    </WfMessage>
    regards
    Steve

  • SOAP over HTTP/POST

    Hi everyone,
    I'd be eternally grateful if someone could provide me with a quick + easy solution to the following (basic?) task.
    I have a user form with the required parameters and a submit button. I have an XML schema which specifies the format for the soap requests and responses. How do I accept user input, wrap it into a soap request, send it via HTTP/POST to a server ( http://localhost:9999/xyz/xyz), wait for a soap response and display the response in a readable format to the user when they press the submit button? Not that hard is it?!
    Please try to be a specific as possible because I'm no Java expert. I'm just so confused with all the tutorials about wsdl, bpel, tomcat, jax ws, glassfish etc etc etc!
    I use netbeans and java app server 9, though I'm open to other IDEs/servers.
    Any help will be greatly appreciated,
    Ruth

    https://saaj.dev.java.net/source/browse/*checkout*/saSAAJ: aj/saaj-ri/docs/index.html
    The Java Web Services Tutorial:
    http://java.sun.com/webservices/docs/1.6/tutorial/doc/index.html
    (Chapter 5)
    SOAP Tutorial: http://www.w3schools.com/soap/default.asp

  • Query regarding encoding/decoding of XML over HTTP Post request

    Hello,
    I am working on a project where I need to put SMS inside XML and
    eventually transfer this XML via HTTP post from/to server/client.
    Assuming the SMS to be 7-bit text the XML may look something like
    <?xml+version="1.0"?>
    <SMS
    TESTMESSAGE
    </SMS>
    This XML when encoded in a HTML post may look something like
    http://<IP Address>:<port>/
    POST /MessageReceiver.jsp HTTP/1.0
    Host: www.SomeHost.net
    Content-Type: application/x-www-form-urlencoded
    Content-Length: 90
    xmlMsg=%3C%3Fxml+version%3D%221.0%22%3F%3E%0D%0A%3CSMS%0D%0A%09TESTMESSAGE0D%0A%3C%2FSMS%3E
    This xml is UTF-8 (7-bit ASCII) by default since no encoding format has been specified.
    My question - how will the encoding of xml change to - when 8 bit binary data
    is transferred via xml.
    for e.g.
    <?xml+version="1.0"?>
    <SMS
    <!!!!!BINARY DATA!!!!!>
    </SMS>
    for such a file how/what shld the encoding be set to.
    Further my spec-states the following.
    "The content of the XML must respect the encoding. Thus a SMS
    containing typically french characters must use ISO-8859-1 encoding"
    "This code needs to work with both UTF-8 and UTF-16 standards (ASCII and Unicode). Because of this the parsing code should work internally with UTF-16 and translate up/down to/from UTF-8 (ASCII) only when dealing with the basic HTTP."
    could anyone clarify this for me.

    The first thing you need to do is clear up some fundamental misconceptions about character encodings. UTF-8 is not the same thing as "7-bit ASCII", and UTF-16 is not the same as "Unicode". Anyway, you're making this a lot more difficult than it needs to be. Just use UTF-8 to encode and decode all messages; it can handle all the characters from any language you're likely to run into.

  • HTTP POST PHP

    Dear J2me people,
    I'm writing an app for midp 1.0 /2.0. It posts data via http post to a php file on a server. It works in emulators and many actual devices.
    However, I've got this problem on Nokia 6230i and Nokia 6101. The data sends OK (HTTP code 200) but doesn't write to database.
    It seems people have come across similar problems on the forums,
    although haven't posted the solution.
    Thank you very much for your time,
    Mark
    code follows::::::::::::::::::::::
    httpConnection = (HttpConnection)Connector.open(url);
                 httpConnection.setRequestProperty("User-Agent","Profile/MIDP-  1.0 Configuration/CLDC-1.0");
                 httpConnection.setRequestProperty("Content-Language", "en-CA");
       httpConnection.setRequestProperty("CONTENT-TYPE", "application/x-www-form-urlencoded");
                  httpConnection.setRequestProperty( "Connection", "close" );
                          httpConnection.setRequestMethod( httpConnection.POST);
    String req = 4&entries=1&date0=2/12&label0=WriteHere&age0=Write%20Here&wagescale0=8" ;               
            httpConnection.setRequestProperty("Content-Length", Integer.toString( req.length()));
              out = httpConnection.openOutputStream();
                int rlength = req.length();
                for ( int i = 0; i < rlength; i++ )
                    out.write( req.charAt(i));
                in = httpConnection.openInputStream();
                      

    hi mark....
    by any chance could you help me with audio streaming via bluetooth from a handset?
    eventually i would like to mount the application onto a dell axim PDA.
    i hav a bit of code you can look @ which has a about 3/4 errors of which i dont know. im sure there is a truck load of imports to add to this code but im not sure as to which ones.
    please please help if u can, thanks.
    package javax.bluetooth;
    import java.io.DataOutputStream;
    public class firstone {
    public void transfer(DataOutputStream output) {
    try{
    int i = 0;
    int auglis = 50058; //chunk size
    //if it is wav file, we need to edit header:
    // audio[4] = (byte)0x8A;
    // audio[5] = (byte)0xC3;
    // audio[6] = (byte)0x00;
    // audio[7] = (byte)0x00;
    // audio[54] = (byte)0x50;
    // audio[55] = (byte)0xC3;
    // audio[56] = (byte)0x00;
    // audio[57] = (byte)0x00;
    byte[] tmp = new byte[50058];
    int countBytes= 0;
    int headerup = 32; //mp3 header is 32 bytes.
    while(i<50058){
    tmp[i] = audio; //byte array audio is byte array from mp3 file
    i++;
    countBytes++;
    output.writeInt(50058); //write to midlet, that chunk size will be 50058
    output.write(tmp); //write chunk itself
    boolean varam = true; //booleand that will become false, when file ends
    while(varam){
    int tmplen = garums - countBytes; //check if it is not last chunk
    int o=50058;
    if(tmplen>50058){           //if it is not last chunk
    o = 50058;
    } else{
    o = tmplen+headerup; // if it is last chunk
    tmp = new byte[o];
    varam = false; //out while loop will end
    int z = 0;
    while(z<32){                 //write 32 byte header to chunk
    tmp[z] = audio[z];
    z++;
    countBytes++;
    while(z<o){                  //white chunk it self
    tmp[z] = audio[i];
    z++;
    i++;
    countBytes++;
    headerup = headerup +32;
    output.writeInt(o); //white size of chunk (typically 50058)
    output.write(tmp); //white chunk itself
    } catch (Exception e) {}

  • Error Unexpected end of file from server with HTTP POST

    Hi everyone,
    I'm coding a simple client to download some information from a local machine in my LAN.
    I have to do this with an http post request.
    When i try to parse the http response the program catch an exception, this one:
    java.net.SocketException: Unexpected end of file from server
    at sun.net.www.http.HttpClient.parseHTTPHeader(...)
    the parameter is a JSON request, and of course the response is a JSON formatted.
    i put the http request code:
    import java.io.BufferedInputStream;
    import java.io.BufferedReader;
    import java.io.ByteArrayOutputStream;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.io.OutputStreamWriter;
    import java.net.HttpURLConnection;
    import java.net.URL;
    public class HttpDownloaderThread  extends Thread{
         private String url;
            private String param;
         private HttpDownloadListener listener;
         private HttpURLConnection connection=null;
         private InputStream is;
            private OutputStreamWriter wr;
         public HttpDownloaderThread(String _url,String param, HttpDownloadListener _listener){
              url = _url;
              listener = _listener;
                    this.param=param;
         public void run(){
              try{
                   connection=(HttpURLConnection)new URL(url).openConnection();
                            connection.setRequestMethod("POST");
                            connection.setReadTimeout(5000);
                            connection.setRequestProperty("Content-Type", "application/jsonrequest");
                            connection.setDoOutput(true);
                            wr = new OutputStreamWriter(connection.getOutputStream());
                            wr.write(param, 0, param.length());
                            wr.flush();
                            int responseCode=0;
                   System.out.println();
                            try{
                             responseCode= connection.getResponseCode();
                            }catch(Exception e){
                                e.printStackTrace();
                   if (responseCode == HttpURLConnection.HTTP_OK){
                        is = connection.getInputStream();
                                     BufferedReader rd = new BufferedReader(new InputStreamReader(is));
                                    String line;
                                    while ((line = rd.readLine()) != null) {
                                        System.out.println(line);
                        closeHttpConnection();
                        listener.resourceDownloaded(url, null);
                                else{
                                closeHttpConnection();
                                listener.downloadFailed(url, new Exception("Http error: " + Integer.toString(responseCode)));
              }catch(Exception e){
                   e.printStackTrace();
                   listener.downloadFailed(url, e);
              }finally{
         public void closeHttpConnection(){
              if (is != null){
                   try{
                        is.close();
                                    wr.close();
                   }catch (Exception e){
                   }finally{
                        is = null;
                                    wr=null;
              if (connection != null){
                   try{
                        connection.disconnect();
                   }catch (Exception e){
                   }finally{
                        connection = null;
    }there's someone who know's why??
    Thanks to everyone :)
    Thomas.

    jole_star wrote:
    this problem also happen to me,.So since you provided actually no information about your problem you are going to get exactly the same response.
    Please don't hijack old threads. Start your own and provide much much much more information.
    I shall lock this thread.

  • How to make HTTP connection between a midlet and a php server?

    As the title above, can anyone share how to make a HTTP connection between those 2? J2ME and PHP. Thanks a lot!

    Can you be a little more specific on what you really want.
    When i started doing j2me application, i was required to be able to comunicate to a oracle client database, and my first though was using PHP based pages to comunicate and do the query. Later they would just generate the answer and get it on the cellphone. You can communicate with a PHP server via either GET or POST. I'd choose POST as is more secure IMO.
    Here are quite a good ammount of examples of how you can do it
    http://www.java2s.com/Code/Java/J2ME/Networks.htm
    They aren't PHP based examples, but you have can an idea of how it can be done

  • Problem in sending HTTP request to the server.

    Hi,
    i dveloped an ant script for sar deployment.
    i deployed a sar to my local soa server with ant script. it got deployed succesfully..
    but when i try to deploy to a remote server, getting the below error..
    "Problem in sending HTTP request to the server. Please make sure the server is up and/or check standard HTTP response code for 404"
    but the server is up and runnig and i am able to ping it from my machine and also access the console...
    below is my script
    build.properties
    wn.bea.home=C:/Oracle/Middleware
    all.needed.jars.path=D:/SourceCode/neededJAR
    oracle.soa.home=C:/Oracle/Middleware/Oracle_SOA1
    java.passed.home=C:/Oracle/Middleware/jdk160_24
    #Deployment environment
    deployment.plan.environment=DEV
    #Deploy Action
    deployAction =redeploy
    #credentials
    user=weblogic
    password=welcome1
    #For Composite deployment
    serverURL=http://10.177.154.6:7001
    forceDefault=true
    server=10.177.154.6
    port=7001
    sarLocation=D:/SourceCode/JAR
    build.xml
    <?xml version="1.0" encoding="iso-8859-1"?>
    <project name="soaDeployAll" default="deployAll">
         <echo>basedir ${basedir}</echo>
         <property environment="env"/>
    <echo>current folder ${basedir}</echo>
         <property file="${basedir}/build.properties"/>
         <taskdef resource="net/sf/antcontrib/antlib.xml">
         <classpath>
              <pathelement location="${all.needed.jars.path}/ant-contrib.jar"/>           
         </classpath>
         </taskdef>
         <target name="init">
              <tstamp>
                   <format property="timestamp" pattern="yyyy-MM-dd_HH-mm-ss"/>
              </tstamp>
              <property name="build.log.dir" location="${basedir}/buildlogs"/>
              <mkdir dir="${build.log.dir}"/> <property name="build.log.filename" value="build_${timestamp}.log"/>
              <record name="${build.log.dir}/${build.log.filename}" loglevel="verbose" append="false"/>
              <echo message="Build logged to ${build.log.filename}"/>
         </target>
         <target name="deployAll" depends="init">
         <echo>Deploy for environment ${deployment.plan.environment}</echo>
         <antcall target="deployAllComposites"/>
    </target>
    <!-- Following Actions are performed for Composite files in Managed Server - Deploy,Redeploy -->
         <target name="deployAllComposites" depends="init">
         <foreach target="deployComposites" param="Files">
              <fileset dir="${sarLocation}" casesensitive="no" includes="*.jar"/>
         </foreach>
         </target>
         <target name="deployComposites" depends="init">
         <basename file="${Files}" property="basename"/>
    <echo>Deploy Project ${basename} for environment ${deployment.plan.environment}</echo>
              <if>
                   <equals arg1="${deployAction}" arg2="deploy" />
                   <then>
                        <echo message="Deploying composites in Managed server........." />
                        <ant antfile="${oracle.soa.home}/bin/ant-sca-deploy.xml" inheritAll="true" target="deploy">
                             <property name="serverURL" value="${serverURL}"/>
                             <property name="user" value="${user}"/>
                             <property name="password" value="${password}"/>
                             <property name="overwrite" value="false"/>
                             <property name="forceDefault" value="${forceDefault}"/>
                             <property name="sarLocation" value="${sarLocation}/${basename}"/>
                        </ant>
                   </then>
                   <else>
                        <echo message="ReDeploying composites in Managed server........." />
                        <ant antfile="${oracle.soa.home}/bin/ant-sca-deploy.xml" inheritAll="true" target="deploy">
                             <property name="serverURL" value="${serverURL}"/>
                             <property name="user" value="${user}"/>
                             <property name="password" value="${password}"/>
                             <property name="overwrite" value="true"/>
                             <property name="forceDefault" value="${forceDefault}"/>
                             <property name="sarLocation" value="${sarLocation}/${basename}"/>                         
                        </ant>
                   </else>
              </if>
    </target>
    </project>
    please help....

    Hi,
    Give the serverURL as http://<host>:<managed.server.port>/soa-infra/deployer and try.
    e.g . http://10.177.154.6:8001/soa-infra/deployer
    Regards,
    Neeraj Sehgal

  • HTTP POST from SAP to an external server

    Experts.
    I have a XML file encased in MIME and SOAP format. Essentially it's a .xml file.
    I need to post this to an external server (have the IP address and logon credentials) using http post functionality.
    Can this be accomplished in SAP using ABAP, Function module? I need to post the entire file.
    If anyone has done this, can you please post the steps needed?
    Thank you so much.
    Raj

    Hi Raj,
    a good starting point for you would be the SAP Help. [Here|http://help.sap.com/saphelp_nw04/helpdata/en/1f/93163f9959a808e10000000a114084/frameset.htm] is some sample code of how to make a HTTP call from ABAP.
    Cheers
    Graham Robbo
    Edited by: Graham Robinson on Oct 28, 2009 2:44 PM

  • HTTP post data from the Oracle database to another web server

    Hi ,
    I have searched the forum and the net on this. And yes I have followed the links
    http://awads.net/wp/2005/11/30/http-post-from-inside-oracle/
    http://manib.wordpress.com/2007/12/03/utl_http/
    and Eddie Awad's Blog on the same topic. I was successful in calling the servlet but I keep getting errors.
    I am using Oracle 10 g and My servlet is part of a ADF BC JSF application.
    My requirement is that I have blob table in another DB and our Oracle Forms application based on another DB has to view the documents . Viewing blobs over dblinks is not possible. So Option 1 is to call a procedure passing the doc_blob_id parameter and call the web server passing the parameters.
    The errors I am getting is:
    First the parameters passed returned null. and
    2. Since my servlet directly downloads the document on the response outputStream, gives this error.
    'com.evermind.server.http.HttpIOException: An established connection was aborted by the software in your host machine'
    Any help please. I am running out of time.
    Thanks

    user10264958 wrote:
    My requirement is that I have blob table in another DB and our Oracle Forms application based on another DB has to view the documents . Viewing blobs over dblinks is not possible. Incorrect. You can use remote LOBs via a database link. However, you cannot use a local LOB variable (called a LOB <i>locator</i>) to reference a remote LOB. A LOB variable/locator is a pointer - that pointer cannot reference a LOB that resides on a remote server. So simply do not use a LOB variable locally as it cannot reference a remote LOB.
    Instead provide a remote interface that can deal with that LOB remotely, dereference that pointer on the remote system, and pass the actual contents being pointed at, to the local database.
    The following demonstrates the basic approach. How one designs and implements the actual remote interface, need to be decided taking existing requirements into consideration. I simply used a very basic wrapper function.
    SQL> --// we create a database link to our own database as it is easier for demonstration purposes
    SQL> create database link remote_db connect to scott identified by tiger using
      2  '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521))(CONNECT_DATA=(SID=dev)(SERVER=dedicated)))';
    Database link created.
    SQL> --// we create a table with a CLOB that we will access via this db link
    SQL> create table xml_files( file_id number, xml_file clob );
    Table created.
    SQL> insert into xml_files values( 1, '<root><text>What do you want, universe?</text></root>' );
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> --// a local select against the table works fine
    SQL> select x.*, length(xml_file) as "SIZE" from xml_files x;
       FILE_ID XML_FILE                                                                                SIZE
             1 <root><text>What do you want, universe?</text></root>                                    53
    SQL> --// a remote select against the table fails as we cannot use remote pointers/locators
    SQL> select * from xml_files@remote_db x;
    ERROR:
    ORA-22992: cannot use LOB locators selected from remote tables
    no rows selected
    SQL> //-- we create an interface on the remote db to deal with the pointer for us
    SQL> create or replace function ReturnXMLFile( fileID number, offset integer, amount integer ) return varchar2 is
      2          buffer  varchar2(32767);
      3  begin
      4          select
      5                  DBMS_LOB.SubStr( x.xml_file, amount, offset )
      6                          into
      7                  buffer
      8          from    xml_files x
      9          where   x.file_id = fileID;
    10 
    11          return( buffer );
    12  end;
    13  /
    Function created.
    SQL> --// we now can access the contents of the remote LOB (only in 4000 char chunks using this example)
    SQL> select
      2          file_id,
      3          ReturnXMLFile@remote_db( x.file_id, 1, 4000 ) as "Chunk_1"
      4  from       xml_files@remote_db x;
       FILE_ID Chunk_1
             1 <root><text>What do you want, universe?</text></root>
    SQL> --// we can also copy the entire remote LOB across into a local LOB and use the local one
    SQL> declare
      2          c               clob;
      3          pos             integer;
      4          iterations      integer;
      5          buf             varchar2(20);   --// small buffer for demonstration purposes only
      6  begin
      7          DBMS_LOB.CreateTemporary( c, true );
      8 
      9          pos := 1;
    10          iterations := 1;
    11          loop
    12                  buf := ReturnXMLFile@remote_db( 1, pos, 20 );
    13                  exit when buf is null;
    14                  pos := pos + length(buf);
    15                  iterations := iterations + 1;
    16                  DBMS_LOB.WriteAppend( c, length(buf), buf );
    17          end loop;
    18 
    19          DBMS_OUTPUT.put_line( 'Copied '||length(c)||' byte(s) from remote LOB' );
    20          DBMS_OUTPUT.put_line( 'Read Iterations: '||iterations );
    21          DBMS_OUTPUT.put_line( 'LOB contents (1-4000):'|| DBMS_LOB.SubStr(c,4000,1) );
    22 
    23          DBMS_LOB.FreeTemporary( c );
    24  end;
    25  /
    Copied 53 byte(s) from remote LOB
    Read Iterations: 4
    LOB contents (1-4000):<root><text>What do you want, universe?</text></root>
    PL/SQL procedure successfully completed.
    SQL> The concern is the size of the LOB. It does not always make sense to access the entire LOB in the database. What if that LOB is a 100GB in size? Irrespective of how you do it, selecting that LOB column from that table will require a 100GB of data to be transferred from the database to your client.
    So you need to decide WHY you want the LOB on the client (which will be the local PL/SQL code in case of dealing with a LOB on a remote database)? Do you need the entire LOB? Do you need a specific piece from it? Do you need the database to first parse that LOB into a more structured data struct and then pass specific information from that struct to you? Etc.
    The bottom line however is that you can use remote LOBs. Simply that you cannot use a local pointer variable to point and dereference a remote LOB.

  • Send POST data from custom POD to PHP server

    Hi all,
    I tried to send data from custom POD to PHP server with POST method. I used HTTPService component and URLLoader, but nothing happend. All attempts failed, HTTPService return "fault" and URLLoader return "0" that means I can't send data to the server.
    I'm googling around during few hours... please give me some advice, how I can send data from custom POD to PHP server.
    Thanks

    Figured it out, hope it will help someone
    A bit tricky but it works fine, now I can send and retrive data from PHP server.
    Add .htacces file in folder where deployed PHP request handler and modify it, see below:
    RewriteEngine on
    RewriteBase /foldername
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)\?*$ filename.php?_route_=$1 [L,QSA]
    Thanks

Maybe you are looking for