WAP HTTP POST problems

We believe we have run into a limitation with POSTing sizes through a WAP gateway. We are using a Blackberry 7230 (MIDP 1.0) over T-Mobile. We believe that T-Mobile uses the Nokia Artus gateway.
What we have found is there seems top be a 2k limit on the amount of POSTed data, as our getResponseCode() call times out with 2874 bytes but succeeds with 1794 bytes. Can anyone confirm this? If so, what is the actual limit? Can anyone suggest a workaround?
Thanks in advance.
Jim

Hi Jim,
I need some inputs related to Blackberry.
I posted below query to blackberry guys, but unfortunately i didn't get any response.
I want to send alerts to Blackberry devices using MDS service, and display
the data without any user interaction. Once it is displayed user can
interact with the display object.
As per the info available in the site and feed back from blackberry guys , i have
to write two components
1. Background listening thread that runs on start-up that will await for
incoming data
2.GUI component that the user can run and interact with and this will also
interact with the background listening thread to display new data that
arrives.
I need some clarifications on the above components.
Assumed the i developed both the components and deployed in device.
1. When a new data arrives, does the GUI component can be displayed
(invoked) automatically? or the Gui component has to be in run mode (user
already invoked the component) ?
2. Can i make the gui component as MIDP1.0 component? ie can i use midlet,
for the alerts display?
3. Why i want to use MIDP is for portability. In future, if the blackberry
connect architecture come into play, at least my gui (Midlet) component can
be portable to other devices.
4. The basic question is can my background thread, invoke another
application (MIDP) with out any user interaction?
ie the thread receives data from MDS and invokes MIDP application and gives
the data (or stores in RMS) to that application to display the data with out
any user interaction. Once it is displayed user can close the application.
I really appreciate your freed back.
Thanks & Regards
phani

Similar Messages

  • Apache Bridge HTTP POST problems on large file upload

    I have a problem uploading files larger than quarter a mega, the jsp
    page does a POSTto a servlet which reads the input stream and writes to
    a file.
    Configuration: Apache webserver 1.3.12 connected to the Weblogic 5.1
    application server via the bridge(mod_wl_ssl.so) from WebLogic Service
    pack 4.
    The upload goes on for about 30 secs and throws the following error.
    "Failure of WebLogic APACHE bridge:
    IO error writing POST data to 100.12.1.2:7001; sys err#: [32] sys err
    msg [Broken pipe]
    Build date/time: Jul 10 2000 12:29:18 "
    The same upload(in fact I uploaded a 8 MEG file) using the
    Netscape(NSAPI) WebLogicconnector.
    Any answers would be deeply appreciated.
    [email protected]

    It appears to be a bug.
    I suggest that you file a bug report with our support organization. Be sure
    to include a complete test case. They will also need information from
    you -- please review our external support procedures:
    http://www.beasys.com/support/index.html
    Thanks,
    Michael
    Michael Girdley
    Product Manager, WebLogic Server & Express
    BEA Systems Inc
    "George Abraham" <[email protected]> wrote in message
    news:[email protected]..
    I have a problem uploading files larger than quarter a mega, the jsp
    page does a POSTto a servlet which reads the input stream and writes to
    a file.
    Configuration: Apache webserver 1.3.12 connected to the Weblogic 5.1
    application server via the bridge(mod_wl_ssl.so) from WebLogic Service
    pack 4.
    The upload goes on for about 30 secs and throws the following error.
    "Failure of WebLogic APACHE bridge:
    IO error writing POST data to 100.12.1.2:7001; sys err#: [32] sys err
    msg [Broken pipe]
    Build date/time: Jul 10 2000 12:29:18 "
    The same upload(in fact I uploaded a 8 MEG file) using the
    Netscape(NSAPI) WebLogicconnector.
    Any answers would be deeply appreciated.
    [email protected]

  • Http POST problem

    Hello,
    I have googled and also have spoken alot with people on IRC but we are all at a loss with it.
    I want to write a small tool that creates a picture (screenshot) of the current screen and then automatically uploads it to http://www.imageshack.us/index.html and returns the url to the picture in some way.
    The problem is that i don't know how to get the upload working. I have read Sun's one-site-tutorial (but their cgi-thingie that was set up to try it out has been taken off). Then i tried it using imageshacks register-site, the url is: http://reg.imageshack.us/content.php?page=register
    I simply changed the url to that and i also changed
    out.println("string=" + stringToReverse);to
    out.println("email1=abc");(email1 is the first textfield)
    It should give me the "The two email fields do not match - please try again"-like-site. But it just gives me the site from the beginning (http://reg.imageshack.us/content.php?page=register).
    So, whats wrong here? Also i wonder how to split email1 and email2 (with the "&" or writing "\r\n"?
    I finally found working code that confuses me, url: http://www.cs.umd.edu/class/fall2004/cmsc424-0201/ta/examples/Validator.java
    The httpC.setRequestMethod codelines seem alright, but...
        s = "--" + boundary + eol
          + "Content-Disposition: form-data; name=\"ss\"" + eol
          + "Content-Type: text/html; charset=ISO-8859-1" + eol
          + eol + 1 + eol
          + "--" + boundary + eol
          + "Content-Disposition: form-data; name=\"uploaded_file\"; filename=\""
          + args[0] + "\"" + eol
          + "Content-Type: text/html; charset=ISO-8859-1" + eol + eol;and
        out.writeBytes( eol + "--" + boundary + "--" + eol);eh?)
    I have no idea what this is for, if its asked by imageshack or if its standard when sending the file, what would i write there if i want to upload an image? It confuses me. I'm at a loss what to do now.
    Greetings from germany!

    A file upload through HTTP is handled by using a multipart request. A multipart requests consists of MIME headers, which is partly what is in that last piece of code.
    I suggest you look into the HttpClient package, I believe it can do a file upload for you. Otherwise look into the file upload and mime RFC's, they might give you some clues. (RFC = request for comment)
    http://jakarta.apache.org/commons/httpclient/
    (checking the example code, there is a MultipartFileUploadApp example)

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

  • Invoking http post from BPEL is not passing parameters

    Hi,
    I have a simple BPEL process where I am trying to send an xml string in a request
    parameter to a servlet. Servlet is pretty simple. It just prints the request parameters and returns. But problem is that I am not getting any request
    parameters when I am using http post but everything works fine when using
    http get.
    Enclosed is the wsdl that I am using.
    Any information will be of great help
    Thanks
    Rajesh
    <?xml version="1.0" encoding="utf-8"?>
    <definitions
    targetNamespace="http://xmlns.oracle.com/OISService"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
    xmlns:client="http://xmlns.oracle.com/OISService"
    xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    >
    <types>
    <xsd:schema elementFormDefault="qualified"
    targetNamespace="http://xmlns.oracle.com/OISService"
    xmlns="http://www.w3.org/2001/XMLSchema">
    <xsd:element name="header">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="status" type="xsd:string"/>
    <xsd:element name="description" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    <xsd:element name="responsedata" type="xsd:string"/>
    </xsd:schema>
    </types>
    <message name="SendDataToOISRequestMessage">
    <part name="xmldata" element="client:responsedata"/>
    </message>
    <message name="SendDataToOISResponseMessage">
    <part name="payload" element="client:header"/>
    </message>
    <portType name="SendDataToOIS">
    <operation name="process">
    <input message="client:SendDataToOISRequestMessage"/>
    <output message="client:SendDataToOISResponseMessage"/>
    </operation>
    </portType>
    <binding name="SendDataToOIS" type="client:SendDataToOIS">
    <http:binding verb="POST"/>
    <operation name="process">
    <http:operation location="/Class1"/>
    <input>
    <mime:mimeXml part="xmldata"/>
    <mime:content type="text/xml"/>
    </input>
    <output>
    <mime:mimeXml part="payload"/>
    <mime:content type="text/xml"/>
    </output>
    </operation>
    </binding>
    <service name="SendDataTOOISService">
    <port name="SendDataToOIS" binding="client:SendDataToOIS">
    <http:address location="http://localhost:8888/j2ee/servlet"/>
    </port>
    </service>
    <plnk:partnerLinkType name="SendDataToOIS">
    <plnk:role name="SendDataToOISProvider">
    <plnk:portType name="client:SendDataToOIS"/>
    </plnk:role>
    </plnk:partnerLinkType>
    </definitions>

    In the bpel you can make a http-binding instead of the default soap-binding.
    Maybe this can help you making the call to the servlet/jsp.

  • Is it possible for ODi to do a "https post" of an xml file?

    Hi,
    We would like to use ODI to read from a VIEW and within ODI transform to a target using an XSD to generate an XML file and then do a HTTPS POST. Would be grateful for any pointers.
    we also ran into issues while transforming using a target xsd. Listed below:
    Use Case Context: In an ODI interface, Data from a database view is mapped to a target XSD schema. A package is then created, wherein, in the first step, this interface is executed. Then, in the second and final step, data transferred to the target XSD schema is saved as an XML file using OdiSqlUnload function.
    Problems faced in the above mentioned use case:
    When the data from the target XSD schema is saved as an XML file using OdiSqlUnload function, the XML does not match the XSD, which was initially imported into ODI.
    Regards
    Shema

    Ask them!  Product Feedback
    This is a user to user forum.  We are all end users like yourself.  Know one here knows what Apple is going to do.

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

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

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

  • Not able to send message - http post from MII 12.1.4.53 to PI 7.1

    Hi ,
    Question
    u2022     Is there any configuration to set up in MII and PI to do posting to PI as a web service? If YES, please guide.
    Situation
    u2022     We are with MII version 12.1.4.53 and trying to send message through http post to PI 7.1 server.
    u2022     We are getting the following error HTTP 500 Internal Error Issue.
    u2022     However we are able to post messages from SOAPUI through the same URL and with the MII system which is running on version 12.1.6.91 and 12.1.9.116
    u2022     HTTP Response received as below points to PI Configuration issue.
    Error
        <SOAP:Fault>
          <faultcode>SOAP:Server</faultcode>
          <faultstring>Server Error</faultstring>
          <detail>
            <s:SystemError xmlns:s="http://sap.com/xi/WebService/xi2.0">
              <context>XIAdapter</context>
              <code>ADAPTER.JAVA_EXCEPTION</code>
              <text><![CDATA[
    com.sap.aii.af.service.cpa.CPAObjectNotFoundException: Couldn't retrieve inbound binding for the given P/S/A values: FP=senderService;TP=;FS=null;TS=;AN=null;ANS=null;
    thanks
    Rajesh

    Hi Anudeep,
    The question isNOT ABOUT the format of the URL which MII should use.
    Using the same URL we are able to post the message from other MII versions with in the landscape( MII version 12.1.6 and MII version12.1.9) and through SOAP UI.
    500 Internal server error Problem arises when the message is sent through the same URL from MII 12,1.4 Build(53) to PI 7.1 ( we tried https Post, XI Webservice, WebService action blocks)
    Question:
    Are thre any configuration settings specific to MII version12.1.4 Build 53 which needds to be set in MII to communicate to PI 7.1.
    Thanks
    Rajesh

  • Xfdf post problem introduced in Adobe Reader 9.1.2?

    Hi,
    In the past couple weeks, we've had many customers reporting errors with using the xfdf post-back feature of Adobe Acrobat docuements we use.
    They said this was not a problem before they upgraded to Adobe Reader 9.1.2.
    I have not been able to reproduce the problem here with Adobe Reader 9.1.2, but I'm guessing that maybe their configuration is slightly different from my test configuration of machine/Adobe Reader 9.1.2...
    To summarize how we use xfdf post-back:
    1.) The Adobe Acrobat .pdf has a button image with the Acrobat variant of javascript handling a "button push" to do an http post of the xfdf data to our server.
    2.) The server then processes the xfdf data.
    This has always worked fine in the past, but would appear to (under some yet unspecified client-side circumstances), cause an error.  Note:  the server-side appears to not be the root of the problem because the same server is used with the client-machines (client-machines meaning the acrobat plug-in inside an IE browser) that do work, and also with the client-machines that don't work.
    Additional note:  The client-machines that do work...always work.  The client-machines that don't work, never work.
    Attached is a screenshot of the Microsoft Fiddler (protocol monitor tool) request and response data of the xfdf post.
    Thoughts on what might be the problem?
    Thanks!

    Thank you very much for your response but unfortunately none of the suggested solutions have worked.  When pressing F8 then F8 again, the picture icon toolbar toggles between not being shown and then being shown again so no Save options appear.  When pressing F9, nothing happens at all.  When pressing Ctrl+Shift+S an adobe message appears in the middle of the screen stating the following "This document does not allow you to save any changes you have made to it unless you are using Adobe Acrobat 9, Pro 9 or Pro Extended 9.  You will only be saving a copy of the original document.  Do you want to continue?"  It then prompts you with "OK" or "Cancel".  Upon pressing "OK" absolutely nothing happens.   I have seen this type of message many times before when trying to save pdf files and it has successfully saved the file but for some reason nothing happens in this version of adobe reader.  Do you have any other thoughts at all as to how to solve this?

  • How to send a String to a Servlet using a HTTP POST

    Well, I have designed a servlet that receives a HTTP POST, I was testing it using an HTML form to send (using POST) information, now, I have coded a Java App to send it a string, I don't know how to make the servlet recognize that info so it can make its work, I am posting both codes (Servlet & API) so anyone can guide me and tell me how and where to modify them
    Servlet:
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.sql.*;
    public class xmlwriter extends HttpServlet
    public void service(HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException
    ServletOutputStream salida = res.getOutputStream();
    res.setContentType("text/HTML");
    String cadena = req.getParameter("cadena");
    File f1 = new File ("c:/salida.xml");
    FileWriter out = new FileWriter(f1);
    f1.createNewFile();
    out.write(cadena);
    out.close();
    salida.println("OK");
    Now, the JAVA API is:
    import java.io.*;
    import java.net.*;
    public class HTTPSender {
    public static void main(String[] args) throws Exception {
    URL url1 = new URL
    ("http://localhost:8080/XMLSender/xmlwriter");//internal site
    URLConnection UrlConnObj1 = url1.openConnection();
    HttpURLConnection huc1 = (HttpURLConnection)UrlConnObj1;
    huc1.setRequestMethod("POST");
    huc1.setDoOutput(true);
    huc1.setDoInput(true);
    huc1.setUseCaches(false);
    huc1.setDefaultUseCaches(false);
    String cadena = ""
    + "<root>\n"
    + "<tlf>$TLF$</tlf>\n"
    + "<op>$OP$</op>\n"
    + "<sc>$SC$</sc>\n"
    + "<body>$BODY$</body>\n"
    + "</root>";
         PrintWriter out = new PrintWriter(huc1.getOutputStream());
    System.out.println("string="+cadena);
    out.write(cadena);
    out.close();
    I'm a JAVA newbie, so, maybe I'm getting a bad idea of what I need to do, anyway, every (detailed) help is welcome. What my servlet should do (and it doesn't when I send the message through the API) is to write a file with the info received.

    I'm not trying to send a string from a WEB Page, I'm tryring to send it using a JAVA program, I mean, using a HTTPSender, in fact, I already have made the code to do that:
    import java.io.*;
    import java.net.*;
    public class HTTPSender {
    public static void main(String[] args) throws Exception {
    try {
    String cadena = "Message to be written";
    // Send data
    URL url = new URL("http://localhost:8080/XMLSender/xmlwriter");
    URLConnection conn = url.openConnection();
    conn.setDoOutput(true);
    OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
    wr.write(cadena);
    wr.flush();
    // Get the response
    BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
    String line;
    while ((line = rd.readLine()) != null) {
    // Process line...
    wr.close();
    rd.close();
    } catch (Exception e) {
    And modified my servlet so it can receive anything:
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.sql.*;
    public class xmlwriter extends HttpServlet
    public void service(HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException
    ServletOutputStream salida = res.getOutputStream();
    res.setContentType("text/HTML");
    String cadena = req.toString();
    File f1 = new File ("c:/salida.xml");
    FileWriter out = new FileWriter(f1);
    f1.createNewFile();
    out.write(cadena);
    out.close();
    salida.println("OK");
    Now the problem is that, the servlet in fact DOES create the file, but....the file is empty, that means that no info is arriving to the servlet, why?, how should I send it then? I repeat FORGET about a Web Page Form, that is in the past and I don't need that.

  • Submitting a PDF form via HTTP Post: Beginner's Questions

    Hi,
    I am completely new to PDF forms, so I have been finding the documentation and options overwhelming.
    I am hoping to get pointed to the documentation/tutorials/examples I really need.
    I would like to build a "proof of concept" for my boss.  I would like to include a screen in our Java ( JSP & Spring ) webapp where either a PDF form is embedded or is accessed via a link.
    I have
    Adobe Acrobat Distiller X standard license
    Adobe Acrobat X Standard
    Microsoft Office 2010
    I made a small, 3 field Microsoft Word form.  I then converted it via DIstiller into a PDF form.
    I then found this document about how to submit a PDF form to a server side component:
    http://acrobatusers.com/tutorials/form-submit-e-mail-demystified
    My big problem with this document it doesn't have an example nor an example showing what is going on in a full HTML page.   As I result I have some questions:
    Can I see such an example somewhere?
    Does the call to the javascript function doc.SubmitForm(urlToMyServerSideComponent) go in a script tag on the HTML page like other javascripts?
    Can I execute that submit function from an HTML button or do I need to put a "submit" button on the PDF form?
    Do I need Adobe LiveCycle in order to create a PDF form with a "submit" button?  Free versions?
    Can I send via HTTP POST ?
    Do I need Adobe LiveCycle to crate a PDF form with a digital signature?
    Is there a document/tutorial that fits where I am starting off from? ( Please no books, I am tyring to show my boss that this is something that can be done, in a reasonable amount of time, not time to get and go through a book ).
    Thanks in advance for any tips that get me pointed in the right direction
    Steve

    To answer some of your specific questions:
    2, 3. The submit form button needs to be on the PDF. You can either configure a Submit Form action or use the submitForm JavaScript method.
    4, 6: No to both questions. You can create the form in Acrobat. Such forms are knows as Acroforms, as opposed to XFA forms that are created with LiveCycle Designer. Acroforms have wider support.
    5: Yes, that's the method that's used when submitting to a web server. You have your choice of formats. The "HTML Form" option causes the form data to be submitted in the same format as an HTML form, so the same type of server-side code can be used to process the data. As Dave's tutorial shows, the server should return an FDF as the response, however, as opposed to HTML content.
    It's a mistake to try to embed the PDF in a web page. So much depends on the user's browser, PDF viewer, and how both are configured. PDF forms can be submitted directly from Adobe Reader/Acrobat, so it's not necessary for them to be viewed in a browser. Note that Adobe Reader for iOS/Android don't yet support submitting to a web server (apart from FormsCentral), but that's is supposedly being worked on.
    Since you mentioned digital signatures, be aware that for Reader users to be able to sign, the document has to be Reader-enabled, either with Acrobat Pro or LiveCycle Reader Extensions (which is not the same as LiveCycle Designer). Digital signatures in PDF forms are not yet supported on mobile devices. Also, you will want to submit the entire PDF, as opposed to just the form data, when submitting a digitally signed form.

  • Render html form & send forms's input values as params via HTTP POST

    Hello,
    I'm using appache commons http client to send HTTP post queries to a given url and receive HTTP response then process it.
    one of the requirements of my Application is the following: one of these HTTP Post requests is supposed to return an HTML form with different html types (text filed, text area etc..) that i will need to display in my swing application. one important requirement is that i can't know in advance what the html form field types will be.. it depends on a given parameters that my application send as part of HTTP Post method (using apache http client).
    I Longly searched for a simple solution to this problem . There are many solutions but each one has it's limitations :
    1-i can render the html form inside a JEditorPane .but how can I collect the user entered data inside JEditorPane ? i'm not sure this swing component offers the capability to detect its html contents and more it will be difficult to know what are the values entered by user inside html form rendered by JEditorPane.
    2-are there any Java Embedded browsers that offer some API to enable me detect the html form fields ,capture the data entered by user inside the html form ?
    3-the solution i currently opted for is : parse html & convert html form to swing dialog. currently this solution i use works well but the cost of implementing it is high : it involves difficult parsing logic. this makes me worried .I'm not sure if i'm now using the right & easiest solution.
    I need some advice on What is the simplest and clean solution to render a html form & yet be able to collect user entered inputs & send the user input values as params via java HTTP POST request ?

    dragzul wrote:
    In my opinion, your actual solution is what you need to do. You're trying to "merge" two different kinds of view. Actually, the "easiest" way may be: if you have your data to display, you decide to show it on html or swing.Yes i believe that my current solution may be the unique one for my special requirements. when doing research about this problem i found a multitude of java libraries to convert xml to swing (ex: www.swixml.org) .However i was surprised there are no java libraries to convert HTML forms to swing dialogs -as far as i know-. this is a bit strange. The Limitation is that the developers of the server API are not Java guys and are reluctant to use an xml format that i can easily convert to swing . probably they have their own reasons as they might be using the HTML Response for some other server side work. So I was obliged to deal with an HTML stream that i need to display in my client application and process its data. in my opinion the only way to do this is by developing a HTML form to swing converter package. that's what i did now. i was only worried if i'm complicating things and if there are some easier solutions to this issue.
    thanks

  • Manual HTTP POST from ABAP

    I'm trying to use a kind of botched web service implementation that doesn't come with a WSDL file - so, no generated proxy for me to use. It also needs me to send an XML file via an HTTP POST - not in a SOAP envelope. This presents a problem for me - understandably, this isn't part of WebAS 6.40's web services stuff.
    Does anyone know of a way of manually posting something via HTTP in ABAP? I'm sure there must be some function module or class that exposes that functionality - I just can't find it! Any ideas anyone?

    Hi,
    You can get some idea from following code for your requirment
    DATA: WA_DATA TYPE TSRCLIN,
          WA_RESULT TYPE TY_XML,
          WA_INV_REP TYPE TY_INV_REP,
          T_INV_REP TYPE TABLE OF TY_INV_REP,
          WA_ICA_REC_REP TYPE TY_ICA_REC_REP,
          T_ICA_REC_REP TYPE TABLE OF TY_ICA_REC_REP,
          T_RESULT TYPE T_XML,
          SOURCE_ITAB TYPE ABAP_TRANS_SRCBIND_TAB,
          SOURCE_WA   TYPE ABAP_TRANS_SRCBIND,
          WA_ZTICAUSER TYPE ZTICAUSER.
    DATA: XSLTP TYPE REF TO CL_XSLT_PROCESSOR,
          G_IXML TYPE REF TO IF_IXML,
          G_STREAM_FACTORY TYPE REF TO IF_IXML_STREAM_FACTORY,
          G_ENCODING TYPE REF TO IF_IXML_ENCODING,
          RESSTR TYPE REF TO IF_IXML_OSTREAM,
          HTTP_CLIENT TYPE REF TO IF_HTTP_CLIENT .
    DATA: SURL TYPE STRING.
    DATA: WF_PROXY TYPE STRING ,
          WF_PORT TYPE STRING,
          WF_USER TYPE STRING,
          WF_PASSWORD TYPE STRING,
          RLENGTH TYPE I,
          R_CODE TYPE SY-SUBRC,
          USERID1 TYPE CHAR32.
    CONSTANTS: ENCODING     TYPE STRING VALUE 'UTF-8',
               C_COMMA(1)               VALUE ',',
               C_AP(2)                  VALUE 'AP',
               C_AR(2)                  VALUE 'AR',
               C_CF(2)                  VALUE 'CF',
        CONV->READ( IMPORTING DATA = XMLSTRING LEN = LEN ).
        SPLIT XMLSTRING AT CL_ABAP_CHAR_UTILITIES=>CR_LF INTO TABLE T_DATA.
    * Read Header Information
        READ TABLE T_DATA INDEX 1 INTO WA_DATA.
        SPLIT WA_DATA AT C_COMMA INTO DUMMY SOURCE_SYSTEM_ID DUMMY1.
        TRANSLATE DUMMY TO UPPER CASE.
        CONDENSE DUMMY.
        IF DUMMY <> 'SOURCE SYSTEM ID' OR SOURCE_SYSTEM_ID IS INITIAL.
          STRERROR = C_ERROR6.
        ELSE.
          DELETE T_DATA INDEX 1.
        ENDIF.
        CHECK STRERROR IS INITIAL.
        READ TABLE T_DATA INDEX 1 INTO WA_DATA.
        SPLIT WA_DATA AT C_COMMA INTO DUMMY DATE DUMMY1.
        TRANSLATE DUMMY TO UPPER CASE.
        CONDENSE DUMMY.
        IF DUMMY <> 'DATE' OR DATE IS INITIAL.
          STRERROR = C_ERROR6.
        ELSE.
          DELETE T_DATA INDEX 1.
        ENDIF.
        CHECK STRERROR IS INITIAL.
        READ TABLE T_DATA INDEX 1 INTO WA_DATA.
        SPLIT WA_DATA AT C_COMMA INTO DUMMY TIME DUMMY1.
        TRANSLATE DUMMY TO UPPER CASE.
        CONDENSE DUMMY.
        IF DUMMY <> 'TIME' OR TIME IS INITIAL.
          STRERROR = C_ERROR6.
        ELSE.
          DELETE T_DATA INDEX 1.
        ENDIF.
        CHECK STRERROR IS INITIAL.
        READ TABLE T_DATA INDEX 1 INTO WA_DATA.
        SPLIT WA_DATA AT C_COMMA INTO DUMMY CREATED_BY DUMMY1.
        TRANSLATE DUMMY TO UPPER CASE.
        CONDENSE DUMMY.
        IF DUMMY <> 'CREATED BY' OR CREATED_BY IS INITIAL.
          STRERROR = C_ERROR6.
        ELSE.
          DELETE T_DATA INDEX 1.
        ENDIF.
        CHECK STRERROR IS INITIAL.
        READ TABLE T_DATA INDEX 1 INTO WA_DATA.
        SPLIT WA_DATA AT C_COMMA INTO DUMMY TYPE DUMMY1.
        TRANSLATE DUMMY TO UPPER CASE.
        CONDENSE DUMMY.
        IF DUMMY <> 'TYPE' OR TYPE IS INITIAL.
          STRERROR = C_ERROR6.
        ELSE.
          CONDENSE TYPE.
          L_TYPE1 = REPGRP.
          L_TYPE2 = TYPE.
          TRANSLATE L_TYPE1 TO UPPER CASE.
          CONDENSE L_TYPE1.
          TRANSLATE L_TYPE2 TO UPPER CASE.
          CONDENSE L_TYPE2.
          IF L_TYPE1 NE L_TYPE2.
            IF L_TYPE2 = C_AP.
              CONCATENATE C_ERROR1_AP C_ERROR1
                          INTO STRERROR SEPARATED BY SPACE.
            ELSEIF L_TYPE2 = C_AR.
              CONCATENATE C_ERROR1_AR C_ERROR1
                          INTO STRERROR SEPARATED BY SPACE.
            ELSEIF L_TYPE2 = C_CF.
              CONCATENATE C_ERROR1_CF C_ERROR1
                          INTO STRERROR SEPARATED BY SPACE.
            ENDIF.
          ENDIF.
          DELETE T_DATA INDEX 1.
        ENDIF.
        CHECK STRERROR IS INITIAL.
        DELETE T_DATA INDEX 1.
        LOOP AT T_DATA INTO WA_DATA.
          SPLIT WA_DATA AT ',' INTO WA_RESULT-FITF
                                    WA_RESULT-COUNTERPARTYFITF
                                    WA_RESULT-FUCA
                                    WA_RESULT-COUNTERPARTYFUCA
                                    WA_RESULT-RECONCILIATIONACCOUNT
                                    WA_RESULT-INDICATORCUSTOMERVENDOR
                                    WA_RESULT-INVOICENUMBER
                                    WA_RESULT-DOCUMENTDATE
                                    WA_RESULT-POSTINGDATE
                                    WA_RESULT-DUEDATE
                                    WA_RESULT-INVOICEAMOUNT
                                    WA_RESULT-INVOICECURRENCY
                                    WA_RESULT-REPORTINGAMOUNT
                                    WA_RESULT-REPORTINGCURRENCY
                                    WA_RESULT-INDICATOR
                                    WA_RESULT-CREATIONDATE
                                    WA_RESULT-CLEARINGDATE.
    * Validation of the Structure.                               
          WA_RESULT-SOURCESYSTEM = SOURCE_SYSTEM_ID.
          APPEND WA_RESULT TO T_RESULT.
          WA_INV_REP-INVOICEREPORT = WA_RESULT.
          WA_ICA_REC_REP-ICARECONCILIATIONREPORT = WA_INV_REP.
          WA_ICA_REC_REP-REPGRP = REPGRP.
          WA_ICA_REC_REP-NAMESPACE = C_STR.
          APPEND WA_ICA_REC_REP TO T_ICA_REC_REP.
        ENDLOOP.
        TRY.
            CREATE OBJECT XSLTP.
          CATCH CX_XSLT_EXCEPTION.
        ENDTRY.
        G_IXML = CL_IXML=>CREATE( ).
        G_STREAM_FACTORY = G_IXML->CREATE_STREAM_FACTORY( ).
    ****Create an Endcoding and Byte Order
        G_ENCODING = G_IXML->CREATE_ENCODING( CHARACTER_SET = ENCODING
          BYTE_ORDER = 0 ).
    *****Create Output Stream
        RESSTR =
            G_STREAM_FACTORY->CREATE_OSTREAM_XSTRING( CONTENT ).
    ****Set the Encoding into a stream
        RESSTR->SET_ENCODING( ENCODING = G_ENCODING ).
    * Prepare for Transformation
        SOURCE_WA-NAME = 'BSPXML'.
        GET REFERENCE OF T_ICA_REC_REP INTO SOURCE_WA-VALUE.
        APPEND SOURCE_WA TO SOURCE_ITAB.
        CLEAR XMLSTRING.
        CALL TRANSFORMATION Z_BSP_XSLT
        SOURCE (SOURCE_ITAB)
        RESULT XML XMLSTRING.
        IF SY-SUBRC <> 0.
          STRERROR = C_ERROR3.
        ENDIF.
        DATA: X1 TYPE STRING,
              X2 TYPE STRING.
    * Change encoding from UTF-16 to UTF-8
        SPLIT XMLSTRING AT 'utf-16' INTO X1 X2.
        CLEAR XMLSTRING.
        CONCATENATE X1 'UTF-8' X2 INTO XMLSTRING.
        select single * into WA_ZTICAUSER
        from ZTICAUSER.
        if sy-subrc <> 0.
          clear WA_ZTICAUSER.
        endif.
    SURL = 'http://XXXXXYYYYY:8050/sap/xi/adapter_plain?'.
        CONCATENATE SURL
         'namespace=' 'http%3A//XXXX.com/corp/sapbw/fi/ica/xi111fn1'
                    '&interface=' 'IOA_ICA_ReconciliationReport'
                    '&service=' 'Send_ICA_ReconciliationReport'
                    '&party=' 'ICA_ManualUpload'
                    '&agency='
                    '&scheme='
                    '&QOS=EO&sap-user='  WA_ZTICAUSER-USERID
                    '&sap-password=' WA_ZTICAUSER-PTEXT
                    '&sap-client=' '060'
                    '&sap-language=EN'
                    INTO SURL.
    * Test of XML file.
    *    navigation->set_parameter( name = 'xmlstring'
    *                               value = xmlstring ).
    *    navigation->goto_page( 'XMLTest.xml' ).
    * Navigation Code
        RLENGTH = STRLEN( XMLSTRING ).
        CL_HTTP_CLIENT=>CREATE_BY_URL( EXPORTING URL    = SURL
                                   IMPORTING CLIENT = HTTP_CLIENT ).
        CALL METHOD HTTP_CLIENT->REQUEST->SET_HEADER_FIELD
          EXPORTING
            NAME  = 'Content-Type'
            VALUE = 'text/xml; charset=utf-8'.
        CALL METHOD HTTP_CLIENT->REQUEST->SET_HEADER_FIELD
          EXPORTING
            NAME  = '~request_method'
            VALUE = 'POST'.
        CALL METHOD HTTP_CLIENT->REQUEST->SET_CDATA
          EXPORTING
            DATA   = XMLSTRING
            OFFSET = 0
            LENGTH = RLENGTH.
        HTTP_CLIENT->SEND( ).
        HTTP_CLIENT->RECEIVE( ).
        HTTP_CLIENT->RESPONSE->GET_STATUS( IMPORTING CODE = RLENGTH ).
        XMLSTRING = HTTP_CLIENT->RESPONSE->GET_CDATA( ).
        HTTP_CLIENT->CLOSE( ).
        IF RLENGTH = '200'.
          STRERROR = C_SUCCESS.
    * Update the information into the Table
          TRANSLATE SOURCE_SYSTEM_ID TO UPPER CASE.
          CONDENSE SOURCE_SYSTEM_ID.
          USERID1 = USERID.
          TRANSLATE USERID1 TO UPPER CASE.
          CONDENSE USERID1.
          CALL FUNCTION 'ZFM_BSP_ICA_UPLOAD'
            EXPORTING
              IV_SOURCE      = SOURCE_SYSTEM_ID
              IV_USERID      = USERID1
              IV_TYPE        = TYPE
    *          IV_UPLOAD_DATE = SY-DATUM
    *          IV_UPLOAD_TIME = SY-UZEIT
            IMPORTING
              R_CODE         = R_CODE.
        ELSE.
          STRERROR = C_ERROR4.
        ENDIF.
      ENDIF.
    ENDIF.
    Message was edited by: Mandar Shete

  • Http post from an application with file attachment

    Hi ! I didn't know where else to post this message...
    I'm trying to make a HTTP POST from an application and upload a file with it. I have no problems with the posting, just that I haven't got any ideas how to get the file uploaded as well. I've been reading loads of examples regarding the topic, and searching older posts the forum here, without any help.
    Here's the method i'm using:
                   // open connections
                  URL url = new URL ("TheURL");
                   URLConnection urlConn = url.openConnection();
                              // We do input & output, without caching
                   urlConn.setDoInput (true);
                   urlConn.setDoOutput (true);
                   urlConn.setUseCaches (false);
                              // multipart/form-data because we want to upload a file
                     urlConn.setRequestProperty ("Content-Type", "multipart/form-data");
                  // Open output stream
                     DataOutputStream printout = new DataOutputStream (urlConn.getOutputStream ());
                  // Set the actual content
                     String content = "upfile=" + System.getProperty("user.dir") + "\\file.ext&";
                       content += "other_key-value_pairs";
                  // write the data to stream, and flush it.
                     printout.writeBytes (URLEncoder.encode(content));
                   printout.flush ();
                   printout.close ();
                   // Get the response.
                     DataInputStream input = new DataInputStream (urlConn.getInputStream());
                   FileOutputStream fos=new FileOutputStream("postto.txt");
                   String str;
                     BufferedReader bufr = new BufferedReader(new InputStreamReader(input));
                  // Write response to outputfile
                     while (null != ((str = bufr.readLine()))) {
                         if (str.length() >0) {
                         fos.write(str.getBytes());
                         fos.write(new String("\n").getBytes());
                   input.close ();Now, the response here I get from the url i'm posting to is "Failure, no data-file". I've tried many diff methods of writing the file to the stream, but always get the same result.
    I need to file attached like it would be when using a HTML form's <input type="file">.
    Please help ! This is getting really urgent !

    String content = "upfile=" + System.getProperty("user.dir") + "\\file.ext&";
    content += "other_key-value_pairs";
    printout.writeBytes (URLEncoder.encode(content));
    printout.flush ();
    printout.close ();Actually, what this does is create a request like:
    GET /path/to/file/script.language?upfile=/home/user/file.ext&other=params HTTP/1.1
    Content-Type: multipart/form-data
    -- And other HTTP params --
    The file is not actually appended to the request.
    I really don't know how Java handles the file upload, but you could do it by hand, like so:
    public static void doFileUpload(String url, String filename, Hashtable params) throws IOException {
        // Construct the request
        String boundary = "----------------------mUlTiPaRtBoUnDaRy";
        String request_head = "POST " + url + " HTTP/1.0\r\n" +
                                         "Content-type: multipart/form-data; boundary=" + boundary + "\r\n";
        String request_body = boundary + "\r\n\r\nContent-disposition: form-data; name=\"upload\"" +
                                         "\r\n\r\n";
        BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(filename)));
        int b = -1;
        while((b = in.read()) != -1) {
             request_body += (char)b;
        in.close();
        Enumeration keys = params.keys();
        while(keys.hasMoreElements()) {
            String key = keys.nextElement();
            requst_body += "\r\n" + boundary + "\r\n\r\nContent-type: form-data; name=\"key\"\r\n" +
                                    (String)params.get(key);
        request_body += "\r\n" + boundary + "--\r\n";
        int length = request_head.length() + request_body.length() + "Content-length: \r\n";
        String req_length = "Content-length: " + (length + new String("" + length).length()) + "\r\n";
        Socket socket = new Socket(url,80);
        PrintStream stream = socket.getOutputStream();
        stream.print(request_head + req_length + req_body);
        // And now an option to read the response, I will omit that...   
    }Note: I have not tested this code, just wrote it up out of memory. If it does not work, it will propably need some small fixes.
    Tuomas Rinta

  • HTTPS Post with XI

    Hi mates,
    I've a scenario that complains a RFC call to XI and then, XI makes a HTTPS Post on a specific server.
    I've created a HTTP Destination (type G) on SM59, set it to use SSL at Logon & Security tab, using the DFAULT ssl client(that i've created at STRUST transaction).
    The problem is when i try to TEST the connection, an successful textless message appears in the bottom and nothing happens! The server that will receive the request doesn't receive nothing when it occurs.
    I've debugged the testbutton of SM59 and i found that the problem occurs in cl_http_client, in the method IF_HTTP_CLIENT~RECEIVE, and the exception is http_communication_failure.
    Somebody faced the same problem?
    Is the Destinations created on the J2EE Admin Service avaliable to my XI Communication Channel?
    Thanks in advance.

    Hi Bruno,
    Try using the SOAP adapater instead of the plain HTTP way.
    These links might help:
    http://help.sap.com/saphelp_nw04/helpdata/en/fc/5ad93f130f9215e10000000a155106/frameset.htm
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/d23cbe11-0d01-0010-5287-873a22024f79
    Coe

Maybe you are looking for

  • I have a MAC, when I click on a picture tile in google the selected image will not open, Why?

    When I do a Google search for a product or person on the right side of the page is a little bit of specific information and if available a a little square with a prompt for more images. Clicking on that prompt brings you to a full page of related pic

  • Running Spatial Query as different user

    Has anyone else run into a problem with running a spatial query that works fine in the scheme that created the tables but when I run it after giving permissions to another user it returns no rows. Here is my example and sorry it is little complicated

  • Can't save Cisco ASA configuration in GNS3 via write memory command

    Hi all, I'm having a problem to save Cisco ASA configuration in GNS3 via write memory command.    ciscoasa(config)# wr mem    Building configuration-    Cryptochecksum: c066a7ab b5b9071e bb5ee1f6 2d93be53    %Error copying system:/running-config (Not

  • PL-SQL Solve: Using INSTR and SUBSTR

    I am trying to work on this and cannot get a solution. Please help You have to use INSTR and SUBSTR to solve Question: You have the following acceptable value Numberic: 0-34 80-100 or Non Numberic X S U D- D D+ Im have to use INSTR and SUBSTR functio

  • Cannot find the Hard Drive on Disk Utility

    I am using an iMac (mid 2010) the factory Operating System was Mac OS X 10.6.4 and updated to Mac OS X 10.9.1. Following a "Flashinhg Question Mark" iMac was unable to boot. Then installed OS X on an external HD and boot the iMac. http://support.appl